Question: write the program named Lab06.java that contains the following four static methods: public static double max(double[] data) that returns the maximum value in the array

write the program named Lab06.java that contains the following four static methods:

public static double max(double[] data) that returns the maximum value in the array data

public static double min(double[] data) that returns the minimum value in the array data

public static double sum(double[] data) that sums all items in the array and return the result

public static double ave(double[] data) that call the sum() method and then return the average.

Once you have completed the methods above, write a simple main program that does the following:

1. Asks the user how many items will be entered

2. Creates an array of double of the correct size

3. Prompts the user and reads in the values

4. Calculates and prints out the max, min, sum, and average using the methods above.

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!