Question: It needs to be done in Java. Question 1. (Stats.java) Write a program that prompts the user to enter an arbitrary (this means unknown) number
Question 1. (Stats.java) Write a program that prompts the user to enter an arbitrary (this means unknown) number of positive double numbers. When the user enters a negative number the input is complete. At this point the program should display the count, maximum, minimum, sum, product, average and range (distance between maximum and minimum) of the numbers. Assume the user enters properly-formatted numbers as input. Hint: most of this work can be done inside of a single while loop. C:lcosc1046\a21>java Stats Enter a double number (negative to quit): 1.0 2.0 3.0 4.0 5.0 -1 Count: 5 Max: 5.0 Min: 1.0 Sum: 15.0 Product: 120.0 Average: 3.0 Range: 4.0 Program complete. c:lcosc1046\a2\>java Stats Enter a double number (negative to quit): 10.39 14.219 81.2 o.001 9.983 6.9 12 10012.34 Count: 8 Max: 10012.34 Min: 0.0010 Sum: 10147.033 Product:9.928133947689667E Average: 1268.379125 Range: 10012.339 Program complete
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
