Question: In Java Create the following methods to obtain the statistics of a single-dimension array. public static double min(double[] array) finds the smallest element in an
In Java
Create the following methods to obtain the statistics of a single-dimension array.
public static double min(double[] array) finds the smallest element in an array of double values
public static double max(double[] array) finds the largest element in an array of double values
public static double average(double[] array) calculates the average value in an array of double values
In your main method, write instructions that prompt the user to enter the size of the array to be created. The main method should then create the array, populate it with random values and then display it. Finally, the main method should create an array of that size and use the methods above to obtain and display the minimum, maximum and average values in the array.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
