Author Archives: Pablo Guerra

#QUIZ11 #TC1017

Este quiz se trató de realizar dos archivos, uno que tuviera una lista de numeros y el otro una mezcla de lista de numeros con las palabras BANANA. Estas listas, dependiendo de cuáles se eligiera se iban a correr y para la primera lista se debería obtener la suma de los numeros, el promedio de los numero, el valor del total de numeros y la desviación estandar. Seguido de esa función donde se imprimen los resultados se creó una uncion llamadacheck_BANANA donde se obtienen las veces que esta palabra aparece en la lista previamente creada por el usuario.

Link de acceso al programa:

https://github.com/pabloguerra/TC1017/blob/master/QUIZ11.cpp

#WSQ16 #TC1017

En este WSQ se pidió realiza un programa el cual pudiera abrir un archivo llamado 93cars.dat.txt y que fuera leyendolo. Al leerlo el programa debia de ser capaz de ir almacenando datos sobre el consumo de gasolina dentro la ciudad, afuera de la ciudad y el costo del vehículo en el momento. Se creó una función la cual dentro de ella realizara todo lo anterior. Primero, en la función se abre el archivo mediante “ifstream myfile(“93cars.dat.txt”);” seguido de esto empieza un loop el cual no termina hasta que no se termine de leer el archivo, para esto se utiliza un getline(myfile,first) , así declarando que se debe de correr el archivo previamente abierto a partir de la primera linea. Seguido se empieza a leer el archivo a partir del caracter numero 42 y que a partir de ese se lean 47 más caracteres. Este mismo dato se convierte a un entero para luego hacer la suma de todos los numeros (numero de cada renglón que su residuo sea 0, esto se hace para no tomar cada linea, ya que no es necesario tomar la segunda linea de cada auto. esto se cumple con la condicion que se encuentra previa “if((contador%2)==0)”). Se tomarán 3 datos principalmente, el promedio de gas en la ciudad, el promedio de gas en la la carretera y el precio del vehículo actualmente. Después de haber obtenido cada dato y haberlo convertido en enteros se sacan el promedio de los acumulados. Se imprimen los resultados y el programa concluye.

Fuentes consultadas: 

http://www.cplusplus.com/reference/string/string/substr/

http://www.cplusplus.com/reference/cstdlib/atoi/

http://www.cplusplus.com/reference/string/string/getline/

Link de acceso al WSQ16:

https://github.com/pabloguerra/TC1017/blob/master/WSQ16.cpp

#WSQ15 #TC1017

My schedule for the last weeks is: 

WEEK 1:

Finishing the WSQ15

Continue with the project

Continue with Masteries

WEEK 2:

Finishing the WSQ16

Continue with Masteries

Finish the project

WEEK3:

Finishing the WSQ17

Continue with the project

Finish  Masteries

 

#Project #TC1017

 

Still working on the project, almost done. Just fixing some bugs such as if the user write a letter instead of a number of if the input it´s bigger than the number of rows. Colors are already coded, the board as well. 

#WSQ017 #TC1017

Working with scilab:

At first it thought what the hell is this. But after practicing a little i figured out that was much more easier than c++. Loops are more easier to do than c++ loops. The enviroment it´s quite simple, it could be better. But it´s simplier than c++ that make the program attractive. The good thing after using and learning c++ code is that makes you think like a programmer; a really good thing of it. We should learn a bit more of scilab. 

#QUIZ10 #TC1017

In this QUIZ told us to make two functions. In the first we calculate the sum of just the numbers divisible by 3. In the second one calculate the dot product of two given vectors/arrays. Firs we declared(in the main) the arrays and then i made the function findThrees were the program calculate the sum of the numbers divisible by 3 that compose the array. in the dotProduct function the function recieve 2 arryas that are made in the main and then inside the function the dot product (sum of the product for each array) it´s calculated: EX:  If the input is {2,4,5,6} and {1,2,3,4} the result will be 49 since (2*1)+(4*2)+(5*3)+(6*4) is 49.

 

You can check the code in the following link.

Github link:

https://github.com/pabloguerra/TC1017/blob/master/QUIZ10.cpp

#Project #TC1017

Week 2:

Still wroking on conditionals and putting some decorations, such as colocr, lines, brachets and cool stuff. A bit hard knowing how to code the conditionals.

#ECOS #TC1017

#Project #TC1017

In this first week we started the project. Mitzi and i thought and realized that it´s harder than we thought !! We are working in that figuring out how to do it. 

#QUIZ09 #TC1017

 

Q1:

En este programa se pidió realizar una funcion que imprimiera una primadime de “T”. Para esto se realizó una anidación de for donde el segundo for depende del primero. Dentro del segundo for se imprimen las T´s.

Q2:

En este programa se pidió realizar una funcion que al recibir dos numeros se pudiera elevar el primer numero al segundo numero. Es decir a^b.

Q3:

En este programa se pidió realizar una funcion que al recibir un numer (numero dado por el usuario) se obtuviera el numero de la serie de fibonacci.

Q4:

En este programa se pidió realizar una funcion a la que se le pasara un string y luego dentro de la funcion se invirtiera y dependiendo de la condicion se regresara un false o true. Dentro del main se guarda la respuesta de la funcion y se inserta en un condicional. El cual dice si es palindromo o no dependiendo de si es true or false. 

 

 

Aquí pueden ver el link a mi github con los programas:

https://github.com/pabloguerra/P_2/tree/master