Question: Write a Java program using the following methods: A method to fill the array with random numbers: the elements of the array should be random
Write a Java program using the following methods:
A method to fill the array with random numbers: the elements of the array should be random integers between 0 and 100 (declared as class constants).
A method to print the elements of the array in a table like format (6 elements/line - declared as a class constant) A method to find the maximum element in the array
A method to find the minimum element in the array
Have the size of the array declared as a class constant (30). The methods should take as input parameters the array and its size. The method to print should add one more parameter for the number of elements on each line. Write a driver program to call these methods and display the difference between the maximum and the minimum element in the array.

Sample output: Do you want to start (Y/N): y The array elements are: 56 90 14 85 39 34 83 81 797 63 72 65 5652 30 91 34 8 23 91 81 63 100 90 22 26 37 13 90 The difference between the max value 100 and the min value 7-93 Do you want to continue (Y/N): y The array elements are: 29 37 46 94 2 13 7 79 91 41 46 23 61 1755 75 22 30 28 71 71 2 63 52 8 7 83 64 27 24 The difference between the max value 94 and the min value 292 Do you want to continue (Y/N): y The array elements are: 55 48 60 23 43 35 25 54 74 18 78 16 44 30 70 25 6 24 93 42 39 91 1 84 76 40 35 1 17 79 The difference between the max value 93 and the min value 1-92 Do you want to continue (Y/N): a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
