--Originally published at Ariatne's Blog
So this one was a tad bit difficult to do, mostly the yes/no question part, anyway is been done and here are the mastery topics for this programa and the code:
- Creation and use of strings
- Validated user input (ensure correct/expected data entry)
--Originally published at Blog TC1017
--Originally published at Blog de Aitor
This assignment was difficult form me but at the end I finally made it work I hope you understand it
--Originally published at Regular Blog
“El resultado de multiplicar una serie de números naturales en orden descendente, como 4, 3, 2, 1.
Su símbolo es “!”
4! = 4 × 3 × 2 × 1 = 24
7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5040″
–Recuperado de: https://www.disfrutalasmatematicas.com/definiciones/factorial.html
In this assignment I used “” cher “”, que es para crear una variable de texto, la cual utilicé al momento de preguntarle al usuario si deseaba continuar.
Para la parte de calcular el factorial del número que nos da el usuario, utilicé el siguiente loop…
–> Antes del loop se aclara que a Y se le asigna el valor de 1. En el loop… mientras X sea mayor a 1, se multiplicará Y (1) por X (el valor que le asignó el usuario), y al final se le restará 1 a X, para que cuando se repita el loop, Y se multiplique por un número cada vez menor a partir del primer valor que le asignó el usuario.
Al final, después de preguntar al usuario si desea continuar, usé el siguiente loop…
cout<<"Te deseo suerte en este mundo de pecados y pecadores"<Donde si el usuario responde cualquier cosa que no sea ‘s’, le deseará suerte y se terminará el programa.
--Originally published at My TC1017 programming class
Here is the program made for a factorial calculator. There re several notes on the cpp file in case you want to take a look at it.
Here is the link for the loops on C++: http://www.cplusplus.com/doc/tutorial/control/
Here is the link to the Google Drive file: https://drive.google.com/open?id=0B8vzJAbVok1MVjJtX2I2czVTX3c
--Originally published at Future Queen of C++
This was a tricky WSQ because of the integrers and the counter, but I found good references and complete it.
--Originally published at tc1017 – chivas4ever2009
This program seemed to be more difficult, but it was not. It consisted in programming a factorial calculator, the user should introduce any value and the program will provide the factorial of that number. The first thing I had to do was understand what was the mathematical term for ‘factorial’. Then I searched in google for tutorials, I found two different forms of doing it, but I was confused and didn’t understand at all. Then Ken explained that specific program in class because some of us were having problems. So with that and with the research I had done, I could develop my code and it worked.
+Sharing questions at class, because there can be times when other students have the same questions and also everyone can learn something new from the questions.
Links of my research:
--Originally published at Ervin Schlamme´s blog
In this #wsq06 we are going to learn how to create a factorial calculator. First of all we need to know what is a factoria operation (n!), which is the product of every number in a sequence in which n+1 is achieved. For example:
The code for this operation is this one:
using namespace std;
int factorial (int n) // create a function of type integer that give the factorial value of n (n!)
if (n == 0)
int recursion = factorial (n – 1);
int answer = n * recursion;
int main ()
cout << “type number” << endl;
cin >> number;
answer = factorial (number);
cout << “The value for n! = ” << answer << endl; // prints the answer
cout << “Do yu want to try again?” << endl;
cin >> again;
if (again == “yes”) goto repeat;
if (again == “no”)
cout << “Come back soon!” << endl;
cout << “That is not a valid answer, try again simply typing yes or no.” << endl;
in which the result must be like this:
I made a correction on “come back soon” on the code I just showed, in the image it says “Come back soos!”.
Oh, and by the way I used the next #masterytopics:
--Originally published at Valeria CT
For this assignment I tried different types of loops until I found out how to use a goto command and found that it was really helpful. I finally used a string and discovered that I had to include a special library for it.
Here is the link to my program: https://github.com/valeriact/tc1017/blob/master/wsq06.cpp
And the resources that I used:
--Originally published at Solving problems with programming
For these final algorithm was some difficult for me because i have never see the topic in the book or class, but my little friend mariel help out with her code and a little but great explanation.
This is my github link: https://gist.github.com/jesuscmadrigal/2466048b4a0ec5ec0dd459fb9b86a13b
Haga click para ver el pase de diapositivas.