In a class named HW11
write a Java program that fills an array
with ten doubles that are read from the user (hint: use a scanner method named nextDouble()
). Your program should find the largest value, the smallest value, and the average of the array values and print these back to the user nicely (as shown
in the sample output below).
Your program should fill in the entire array first before it does the calculation of the largest, smallest, and average values. Your program does not have to work with negative values.
Turn in a stapled printout of your program with you name on at. Also e-mail me your Java file (the file with the .java file extension) before the start of class.
Here's an example of what your program might look like when you run it.
Enter ten numbers and I'll compute some statistics for you. Enter a number (1): 7 Enter a number (2): 8 Enter a number (3): 99 Enter a number (4): 0 Enter a number (5): 4 Enter a number (6): 3 Enter a number (7): 2 Enter a number (8): 157.456 Enter a number (9): 3.14159 Enter a number (10): 2682679 The largest is: 2682679.0 The smallest is: 0.0 The average is: 268296.259759