Final exam, question 3…

--Originally published at OlafGC / Class #TC1017

Here we are: the final exam. In this video/tutorial, I’m going to explain how to easily write the function for the third question of our final exam. Here is the code and enjoy the ride!

#include <iostream>
#include <cmath>
using namespace std;

float distancia(float x1, float x2, float y1, float y2)
{
float distancia;
distancia = sqrt(pow(x1-x2, 2) + pow(y1-y2, 2));
return distancia;
}

int main()
{
float x1, x2, y1, y2;
cout<<“Please insert four numers in order.”<<endl;
cout<<“X1: “;cin>>x1;
cout<<“X2: “;cin>>x2;
cout<<“Y1: “;cin>>y1;
cout<<“Y2: “;cin>>y2;
cout<<“The distance is “<<distancia(x1, x2, y1, y2)<<“.”<<endl;
return 0;
}


Quiz #08 (Most important, final exam question #4)

--Originally published at OlafGC / Class #TC1017

Hello dear friends! A quick tutorial on how to solve the fourth question of the exam. I hope you find this very useful and thanks for watching!

Code:

#include <iostream>
using namespace std;

int fibonacci(int n)
{
int fib=1, pre=0;
for(int accu=0; accu<n; accu++)
{
fib+=pre;
pre=fib-pre;
} return fib;
}

int main()
{
int res,n;
cout<<“Dame número “<<endl;
cin>>n;
res=fibonacci(n);
cout<<“Tu fibonacci es “<<res<<endl;
return 0;
}


Final Proyect!!

--Originally published at Jpblogworld

Este es uno de mis últimos programas que haré y la verdad se algo pesado pero finalmente se pudo hacer con el apoyo de mi compañero Horacio.

El programa es una base de datos en el cual el usuario puede anotar el nombre del alumno despues escribir algunas calificaciones de tareas, trabajos, exámenes y el programa automáticamente da el promedio de esas calificaciones.

A continuación el codigo:

#include <iostream>

#include <stdio.h>

#include <stdlib.h>

using namespace std;

typedef struct Homework{

int id;

char description[50];

double grade;

}Homework;

typedef struct Test{

int id;

double grade;

}test;

typedef struct Quiz{

int id;

double grade;

char description[50];

}Quiz;

typedef struct Research{

int id;

double grade;

char description[50];

}Research;

typedef struct Partial{

int id;

Homework homeworks[10];

Test tests[10];

Quiz quizzes[10];

Research researches[10];

}Partial;

typedef struct Student{

int id;

char name[50];

Partial partial[3];

}Students;

typedef struct Clas{

int id;

char name[50];

Students students[10];

}Class;

void agregarAlumno(Students []);

void agregarClase(Class[]);

void verClases(Class []);

void modificarAlumno(Students[]);

void mostrarAlumnosPorClase(Class cla);

void verCalificacionAlumnos(Students student[]);

void agregarTarea(Class cla[]);

void mostrarCalificacionPorAlumno(Class cla[]);

void verCalificacionAlumno(Student student);

void eliminarAlumno(Students[]);

void eliminarClases(Class cla[]);

int contadorResearch(Partial partial);

int contadorTarea(Partial partial);

int contadorQuiz(Partial partial);

void agregarQuiz(Class cla[]);

void agregarResearch(Class cla[]);

void verAlumnos(Class []);

void menuPrincipal();

void agregarEliminarVer();

int contadorEstudiantePorClase(Class clas);

int i = 0;

void cargar();

int idClase = 0;

Students al[40];

Class classs[40];

int main()

{

int opcionMenu=0;

int opcionAlumno =0;

int opcionClase = 0;

cargar();

do

{

menuPrincipal();

cin>>opcionMenu;

switch(opcionMenu)

{

case 1:

do

{

agregarEliminarVer();

cin>>opcionClase;

switch(opcionClase)

{

case 1:

agregarClase(classs);

break;

case 2:

verClases(classs);

break;

case 3:

break;

case 4:

eliminarClases(classs);

break;

}

}while(opcionClase!=5);

break;

case 2:

do

{

agregarEliminarVer();

cin>>opcionAlumno;

switch(opcionAlumno){

case 1:

agregarAlumno(al);

break;

case 2:

verAlumnos(classs);

break;

}

}while(opcionAlumno !=5);

break;

case 3:

agregarTarea(classs);

break;

case 4:

agregarQuiz(classs);

break;

case 5:

agregarResearch(classs);

break;

case 6:

mostrarCalificacionPorAlumno(classs);

break;

Continue reading "Final Proyect!!"

Quiz week 14: Autoevaluation

--Originally published at Let&#039;s CODE

I have made my Autoevaluation for the class and this is the result. Autoevaluation – TC1017 Mastery – Sheet1 After a depp reflection, I realize that I need to learn how to use Scilab, make some recursions, and investigate what was the meaning of the las row of the document. I feel satisfied with my … Continue reading Quiz week 14: Autoevaluation

Mastery Topics…

--Originally published at Loading…

Number TC1017 Mastery Topic Done? URL to blog post
1 Use of comments ? https://xalli0421.wordpress.com/2017/01/31/numbers-again/
2 C++ Good Style coding conventions ? https://xalli0421.wordpress.com/2017/03/10/distance-gave-us-a-reason-to-love-harder-%F0%9F%92%AB%F0%9F%92%95/
3 Basic types and their use ? https://xalli0421.wordpress.com/2017/02/14/quiz-6/
4 Basic output (print) ? https://xalli0421.wordpress.com/2017/01/20/hello-world-aleluya/
5 Basic user input (text based) ? https://xalli0421.wordpress.com/2017/01/24/lets-have-fun-with-numbers/
6 Calling functions ? https://xalli0421.wordpress.com/2017/02/07/factorial-calculator/
7 Creating functions ? https://xalli0421.wordpress.com/2017/02/07/now-with-functions/
8 Importing and using libraries ? https://xalli0421.wordpress.com/2017/01/28/there-was-quiz-today/
9 Creating and using your own libraries (program with multiple files) ? https://xalli0421.wordpress.com/2017/03/19/ciento-noventa-y-seis/
10 Use of the conditional “if” ? https://xalli0421.wordpress.com/2017/04/18/quiz/
11 Use of “else” with a conditional if ? https://xalli0421.wordpress.com/2017/02/03/xy-and-xx-minimum-and-squares/
12 Nesting of conditional statements (ifs inside ifs) ? https://xalli0421.wordpress.com/2017/01/28/temperature/
13 Use of loops with “while” and “do while” ? https://xalli0421.wordpress.com/2017/01/30/i-have-a-number-chosen-between-1-and-100/
14 Use of loops with “for” ? https://xalli0421.wordpress.com/2017/03/19/ciento-noventa-y-seis/
15 Nested loops ? https://xalli0421.wordpress.com/2017/03/05/fibonacci-number/
16 Use of recursion for repetitive algorithms ? https://xalli0421.wordpress.com/2017/05/03/e2-71828182845904523536/
17 When to use what type of repetition in a program ? https://xalli0421.wordpress.com/2017/05/02/babylonian-method/
18 Creation and use of Arrays/Vectors in C++ ? https://xalli0421.wordpress.com/2017/03/03/list/
19 Creation and use of strings ? https://xalli0421.wordpress.com/2017/05/02/multipart-data-files/
20 Validated user input (ensure correct/expected data entry) ? https://xalli0421.wordpress.com/2017/02/07/factorial-calculator/
21 Reading and writing of text files ? https://xalli0421.wordpress.com/2017/05/03/go-bananas-or-not-sos/
22 Matrixes and Vectors ? https://xalli0421.wordpress.com/2017/03/03/list/
23 Data analysis with tools (to be determined which tool, most likely SciLab) ☹️
24 Visualization of data with tools  ☹️
Transversal Topics
1 Ability to create C++ file and run from command line (terminal) ?
2 Create accounts: Blog, Twitter, GitHub ?
3 Submit work via Blog RSS and GitHub ?
4 Demonstrate use of Linux sufficient for quizzes/exams ?
5 Install Linux on their own computer ?
6 Ability to create C++ project in IDE and run inside the IDE (advanced topic, not needed early) ?

e=2.71828182845904523536…

--Originally published at Loading…

I was a little confused about this, but this classmate’s blog help me a lot, he has very good codes!

Sorry again, I’m a a little pressed with time so I’m not going to explained it. Actually it’s simple, I’m going to leave this link it explained very well and give some examples, I hope it will be useful.

The libraries that I used for this program was the <iostream> & <iomanip>

e

ee


Go Bananas!… or not? (sos!!)

--Originally published at Loading…

Hi, I think today is the most stressful day in the whole semester ‘cause tomorrow is my Physic exam (and I’m not pretty sure about be ready) aaaaaand, I can’t make this program run correctly… so, in this post I’m not going to explain nothing, I just hope some one could help me to make it work.

Banana.png

It’s supposed is fine, buuuuut… when I run it this happens:

bana Please please please, help me.


Final exam question #1

--Originally published at OlafGC / Class #TC1017

A tutorial video on how to do the “triangle” function for the final exam. Link and code bellow:

#include <iostream>
using namespace std;

int triangle (int size)
{
for(int c1=0; c1<=size; c1++)
{
for (int c2=0; c2<c1; c2++)
{
cout<<“T”;
}
cout<<endl;
}
for (int c1=size-1; c1>0; c1–)
{
for (int c2=c1; c2>0; c2–)
{
cout<<“T”;
}
cout<<endl;
} return 0;
}

int main()
{
int size;
cout<<“Give me the size of your pyramid”<<endl;
cin>>size;
cout<<triangle(size)<<endl;
return 0;
}


Where is my banana?

--Originally published at Adal´s Blog




No soy muy fan de trabajar con string, pero debido a que tengo que saber trabajar con ellas. y que lo veo como un reto personal, es que he decidido hacer las actividades relacionadas con strings, así que comencemos  


Como ya lo habia comnetado antes, no se me da muy bien los strings, por eso acudi al blog de Fabricio y al de María José para tener un poco mas de ayuda



Al final inserte unos caracteres ascii con la palabra banana y una banana debajo que me encontré en Internet, se me hiso que quedaba a la situación, solo que el compilador se volvio loco con unos caracteres y no supo como imprimir algunas lineas ;(

  

Paginas de ayuda: