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.

Write a java program called Average that uses a for loop which

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!