A Dumb Calculator

Make a simple numeric "calculator". It should prompt the user for three numbers. Then add the numbers together and divide by 2. Display the math problem and the result. Your program must support numbers with decimals and not just integers.

What is your first number? 1.1
What is your second number? 2.2
What is your third number? 5.5

( 1.1 + 2.2 + 5.5 ) / 2 is... 4.4

Notice that if you type in different numbers, the output should change:

What is your first number? 3
What is your second number? 4
What is your third number? 5

( 3.0 + 4.0 + 5.0 ) / 2 is... 6.0



©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License