Quiz #1

maxresdefault

Well, this is a new type of post, it is a quiz, the first to be more exact. First of all, I have to say that I hate quizzes, they are shit. Always quizzes makes me freak out, and some times I am too freak out that I can not solve them even though I know the answer. Quizzes should exist but should not count as part of you grade. But that it is just my opinion, I think yours, and that is ok. So last Friday, we had our first quiz, it was about the topics in which were working during class and it was just 3 easy problems to solve. And now iI think you want to know how I solve the quiz, well what did was simple, I just cried until the class was over. I am just kidding, the problems were a piece of cake, I did them in about 10 minutes. If you keep reading my post, I will explain how I solved them.

Problem 1:

The first problem was asking to do a program witch ask to the user hight and radius and the program should calculate the volume. It was very simple, you should just ask to the user for the radius and hight, create a variable for each value and store the values y the variable, just how I did it in lines 8 to 19. After that it was just simple math, you just have to solve the simple equation that was given in the quiz (v=Pi*R*H). As you can see I solve the equation in to different ways, the first one is the easiest, because I just multiply hight and radius time 3.1416. The second way I use was to make Pi a constant and then multiply it times

Captura de pantalla 2016-02-02 a las 11.04.47 a.m.
Captura de pantalla 2016-02-02 a las 11.05.00 a.m.
Captura de pantalla 2016-02-02 a las 11.05.13 a.m.
Captura de pantalla 2016-02-02 a las 11.05.23 a.m.
Captura de pantalla 2016-02-02 a las 11.05.32 a.m.

and radius. If you do not know how to declare them, this link may help you: https://www.programarya.com/Cursos/C++/Sistema-de-Tipos/Variables-y-Constantes. The rest was just printing the results we got.

Captura de pantalla 2016-02-02 a las 11.04.47 a.m.

Problem 2:

The second problem was asking for a program witch ask to the user for to numbers, and the program will do some math operations (+,-,*,/) and give the result for each one. And also the problem said that you should use integers numbers, so in the division the result will be a integer number. Another task of the quiz was to show the remainder of the division. The reminder of the division you could get it using modules, if you do not know read this info http://c.conclase.net/curso/?cap=004. The rest you could solve it like the first one.

Captura de pantalla 2016-02-02 a las 11.05.00 a.m.

Captura de pantalla 2016-02-02 a las 11.05.13 a.m.

Problem 3:

It is the same shit that the second problem, the difference is that you should change the type of variables, instead of using integers you should use floats. Using float will show decimals in all the operations you do, for example 5/2, the result using floats will be 2.5.Captura de pantalla 2016-02-02 a las 11.05.23 a.m.Captura de pantalla 2016-02-02 a las 11.05.32 a.m.

CC BY-SA 4.0 Quiz #1 by manuelch96 is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.