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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started