Well we had to do a quiz.
So I decided to do it by hand, because I thought it would be easier and faster, here goes first program, the problem you had to do was simply calculating the Volume of a cylinder, using the formula. I used ( Pi*(radius*radius)*height)or(3.1416*(radius*radius)*height) or you can use Pi=3.1416, which I think would the best way to do it.
1st and 2nd lines: insert a radius and a height.
Remember to use int to define radius, height
3rd : add the formula for Volume.
4th: print the result of the formula.
Next program was a simple calculator who would multiply two numbers that the user would choose, then the division without remainder, and finally you would get the remainder of the division.
1st & 2nd : ask the user for two numbers, num1 & num2
Remember to use int to define num1, num2
3rd, 4th & 5th : write what the result of each operation will be (num1*num2)(num1/num2) (num1%num2)
Finally we should repeat the 2nd program but this time using “float” instead of “int” and do the addition, substraction, multiplication, and division of two numbers.
1st & 2nd : ask the user for two numbers, num1 & num2
Remember to use float instead of int to define num1, num2
3rd, 4th, 5th & 6th : write what the result of each operation will be (num1*num2)(num1+num2)(num1-num2)(num1/num2) (num1%num2)
That was basically the quiz we had to do in order to prove ourselfes of how much we were capable of doing on our own.
Quiz! by canadamike17 is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.