Find the total and average of the input values


Discuss the below:

Q: Create a Java program that will read integers and find the total and average of the input values, not counting zeros.

My program must end with the input zero.

I have to display the average as a floating point number.

The program must also find the largest and smallest value. It also must find the count of how many entries were entered by the user not including the zero to exit the programs.

If input is 50, 55, 60, 0, my output should be:
The total is 165.
The average is 55.0.
The largest value is 60.
The smallest value is 50.
The number of entries is 3
The input and output must use JOptionPane dialog and display boxes.

 

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Find the total and average of the input values
Reference No:- TGS01935079

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)