Question
Write a Java program that computes the sum and the average of any three decimal numbers provided by the user. The program asks the user
Write a Java program that computes the sum and the average of any three decimal numbers provided by the user.
The program asks the user to input three decimal numbers one at a time. It will compute the sum and the average of the three numbers. Then it will display the three numbers, their sum and the average in a single output dialog box. See Test section below.
-----------------------------------------
Test Run
Enter the first number:
2.5
Enter the second number:
3.3
Enter the third number:
4.4
The sum of 2.5, 3.3 and 4.4 is 10.2
The average of 2.5, 3.3 and 4.4 is 3.4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started