Quiz #1

My first quiz… Let’s start reading what I was supposed to do… 

Captura de pantalla 2016-02-09 a las 11.50.01.png

I had some trouble trying to get the value of π, I did some research and I needed the <cmath> library because I was going to need the value of π. As you are using the cmath library, π is declared as M_PI so you just have to type that when you will use π.  After that, the rest of the program was very simple.

Here is how I wrote my code for the program #1. 

Captura de pantalla 2016-02-09 a las 12.08.02.png

The next program was pretty easy. I was asked to write a program which the user could type two numbers and the program would show the product of the two numbers, the division and the remainder from the division of the two numbers. You shouldn’t have any problem writing this code. Here is how I wrote the program #2.

Captura de pantalla 2016-02-09 a las 12.11.35

And finally, for the last program the only thing that you needed to change was the data type from int to float. You wouldn’t have a remainder from the division, you only were supposed to show the addition, product, subtraction and division of the two float numbers. Here is how I wrote my code for program #3.

Captura de pantalla 2016-02-09 a las 12.17.21.png

Here you can see my codes on GitHub. And here you can see my code working via ScreenCast.

Captura de pantalla 2016-02-09 a las 12.37.48.png

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