Question: Write a java program called Average that uses a for loop which repeats 10 times, within the loop, stores it in an array. Calls the
Write a java program called Average that uses a for loop which repeats 10 times, within the loop, stores it in an array. Calls the method calculateAverage with the ff header: public static double calculateAverage (double[] array) to calculate and return the average in the array(use a for loop to calculate the sum of the values in the array). Display the average value with 2 places after a decimal point.

SAMPLE OUTPUT: java Average Enter double #1: 1 Enter double #2: 2 Enter double #3: 3 Enter double #4: 4 Enter double #5: Enter double #6: 6 Enter double #7: 7 Enter double #8: 8 Enter double #9: 9 Enter double #10 : 10 The average is: 5.50
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
