#WSQ09

--Originally published at May The Code be With You

Hello, Young Padawans!

This time I bring you the third most difficult WSQ (in my opinion).

The WSQ09 ask us to open a text file, count how many lines doest it has, and how many characters.

When I first saw it I say “Whaaaat?! How am I supposed to do so?”. But with the help of Ken and my friend Adal, I found the way.

Well, first of all, is very important that you do some research by your own in google, about how to open files and about structures (are very handy in this assignament). Remember, as Ken said: “Stack Overflow and cplusplus.com are your friends”.

A structure is a format that let you storage several variables, even of different types, inside one concept.

And, you will also need the library <fstream>

WSQ09.png

As you can see in my code, I made a struct named “info” in wich, I saved 2 variables of “int” kind.  After you research, you may see that there are some commands that let you do the exat thing you wanted to do, just like open the file, conunt the lines, and so and so. I hope yu get the syntaxis of this code.

text


#WSQ07

--Originally published at May The Code be With You

Hello, Young Padawans!

I know it´s been a lot since I wrote a blog. But, here am I. Then, let´s begin.

This time I bring you the WSQ07, wich involves the use of Arrays. An Array is a set of characters (numbers in this case) wich give every character a number and an order. In order to use them we use: “[]”.

This WSQ ask us to take a list (array) data, sum its numbers, the average of them, and the standard Deviation.

The Standard Deviation is basically, the average of difference between each number and the actual average. You can read this information here:

https://en.wikipedia.org/wiki/Standard_deviation

First, I will put the photo of my code, then I will explain it.

WSQ07

As you can see, it´s all about “fors”. So, you first make a loop with a variable “i”, wich starts in 0 and add one to it until is lower than 10. You just have to add a variable to sum all the terms for every loop.

Then, to get the average, just divide the summatory of that variable by 10. And for the satandard deviation just follow the formula.

After you think about it, you realize it is quite simple.

pip


#TC1017

--Originally published at Rapture

First of all thanks for everything Ken.

The course is designed for people who want to learn by their own will, and that you as a student are devoted to spend your free time looking for new ways to learn the mastery topics and you will benefit the most if you are an organized person.

In the class there is a Teacher (Ken Bauer) and he is at all times available (here is his schedule), you can book him for half an hour in that link, anda those 30 minutes can be of great help since he guides you through the topics of the semester and you learn from it. In class he is also there if you need any help and if you feel anxious in talking toward the teacher you can always ask anyone froma the class and this kind of activity is what Ken encourages for us students to make.

In short if you are willing to dedicate extra hours and learn by yourself with a guide (Ken) it will help you out a lot, but if you will not demand yourself to study you will have a hard time getting through the semester.


float PromList(){}

--Originally published at Alvaro_246

“Funciones y arreglos”

En este programa hice una función que calcula el promedio de un determinado rango de números elegidos por el usuario. Para lograr esto declare un Array que me permite darle un valor numérico a cada posición del arreglo el cual puedo delimitar con un “for” y una variable como limitante llamada “Cuantos” en este código.

Dentro de la función float PromList(){} hacemos la operación matemática sumando todos los valores de cada posición de los arreglos y dividiéndolos entre la variable Cuantos, para obtener el promedio.

2017-05-08 (1)Codigo:

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

int arreglo[100];
float Promedio = 0;
float PromList();

int main() {
cout << “Este programa Calcula el promdio de una lista” << endl;
cout << PromList();
return 0;

}
float PromList(){
int Cuantos;
cout << “Cuantos numeros ingresara?” << endl;
cin >> Cuantos;

for(int i = 0; i<Cuantos; i++){
cout << “Para posicion [” << i << “] Numero # = “;
cin >> arreglo[i];
}
for(int i = 0; i<Cuantos; i++){
Promedio = Promedio + pow(arreglo[i], 1)/Cuantos;
}
cout << “El promedio de los numeros ingresados es : ” << Promedio << endl;

return Promedio;
}//Alvaro_246

 


float PromList(){}

--Originally published at Alvaro_246

“Funciones y arreglos”

En este programa hice una función que calcula el promedio de un determinado rango de números elegidos por el usuario. Para lograr esto declare un Array que me permite darle un valor numérico a cada posición del arreglo el cual puedo delimitar con un “for” y una variable como limitante llamada “Cuantos” en este código.

Dentro de la función float PromList(){} hacemos la operación matemática sumando todos los valores de cada posición de los arreglos y dividiéndolos entre la variable Cuantos, para obtener el promedio.

2017-05-08 (1)Codigo:

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

int arreglo[100];
float Promedio = 0;
float PromList();

int main() {
cout << “Este programa Calcula el promdio de una lista” << endl;
cout << PromList();
return 0;

}
float PromList(){
int Cuantos;
cout << “Cuantos numeros ingresara?” << endl;
cin >> Cuantos;

for(int i = 0; i<Cuantos; i++){
cout << “Para posicion [” << i << “] Numero # = “;
cin >> arreglo[i];
}
for(int i = 0; i<Cuantos; i++){
Promedio = Promedio + pow(arreglo[i], 1)/Cuantos;
}
cout << “El promedio de los numeros ingresados es : ” << Promedio << endl;

return Promedio;
}//Alvaro_246

 


cout << Piramide << endl;

--Originally published at Alvaro_246

En este programa hacemos una pirámide con alguna altura determinada por el usuario, Para ello utilizamos 2 for (int=0; i<Altura; i++) que son los que se encargan de hacer un Loop que determina la cantidad de caracteres que tendrá como base. Esto se encuentra dentro de una funcion llamada int Triangulo(){}

2017-05-08

Este es mi codigo:

#include <iostream>

using namespace std;
int Triangulo();

int main (){
cout << “Este programa dibuja una piramide de alguna altura en especifico” <<endl;
cout << Triangulo() << endl;

return 0;
}
int Triangulo(){

int Altura;
cout << “Ingresa la altura de la piramide” <<endl;
cin >>Altura;

cout<<endl;
cout<<endl;

for(int i = 0; i<Altura; i++){
for(int j=i+1; j>0; j–)
cout << “TTT”;

cout << endl;
}
return 0;
}//Alvaro_246


Course Evaluation

--Originally published at blog de Horacio

Good evening to all who are reading this.
This course seemed a bit strange at first because the methodology used by Professor Ken seemed a little outside the TEC line, but now I realize that it is very well implemented by Professor Ken, I can tell you about the teacher , Is great in all aspects, as a student more, yes, never misses classes hahaha, I thank the teacher for teaching us the program in a fun and non-restrictive way like the other teachers who give it.
Is a totally different course, but if you think that by doing nothing you are going to learn, you are totally wrong, this course is programming and as such you have to dedicate your time to go over the tasks that the teacher proposes. In conclusion I give it a 100!

happyfunnysmileface


WSQ 13 “SciLab”

--Originally published at blog de Horacio

Scilab es un paquete de computación numérico de código abierto y multiplataforma y un lenguaje de programación orientado numéricamente de alto nivel. Puede usarse para el procesamiento de señales, análisis estadístico, mejora de imágenes, simulaciones de dinámica de fluidos, optimización numérica y modelado, simulación de sistemas dinámicos explícitos e implícitos y manipulaciones simbólicas (si la caja de herramientas correspondiente está instalada).

Fuente: https://en.wikipedia.org/wiki/Scilab. Sí, usé Wikipedia. No estaba de humor para hacer una larga investigación para definir Scilab.

De acuerdo. Comencemos con la publicación del blog.

Scilab es una herramienta realmente útil que me ayudará a partir de ahora a hacer mis cálculos matemáticos. Además no soy muy bueno en matemáticas, Es divertido usar un software de matemáticas con el conocimiento de programación que ya tenemos.

El próximo martes es mi examen final de matemáticas. Definitivamente estoy usando esto para revisar mis ejercicios mientras estudio.
Captura de pantalla 2017-05-07 a la(s) 21.56.37

Finished Project

--Originally published at TC1017

My friend Luis and I finished this Tuesday our project which we are very proud of. Our project is a game programmed in c that will play a song from our list of song and the user will have to guess which song it is. The computer will give the user 4 options and he has to type the option that he thinks is correct. The more correct answers he has the more points he will achieve.

We had some complications in the making but Ken always had out back. First thing we didnt know was how to install the mp3 library into c++ that would play the mp3 from our computer so Ken did that for us.

Then after lots of arrays loops and going to Ken´s office we came up with our 266 line program that worked like this:

Mostrando IMG_1580.JPG

 

We are very proud of our project and believe we can keep adding songs and features to make ir a more complete game!


Calculating e

--Originally published at TC1017

This #wsq12 consisted in calculating the eulers constant and print the number with the precision that the user wants. In order to do this program I saw other student posts and saw the function “setprecision” which made the rest pretty easy. The program is below.

euler.pngeuler1.png