Problem 19

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 result. Your program must support numbers with decimals and not just integers.

~/.../pbd-solutions/19$ java DumbCalculator

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

◄ 18: Age in Five Years 20: BMI Calculator ►



Adapted from ProgrammingByDoing.com
©2013 Graham Mitchell

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