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

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. (The sample of the out put is above)

Sample output: Do you want to start (Y/N) y The array elements are 56 90 14 85 39 34 83 81 79 7 63 72 65 56 52 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 17 55 75 22 30 28 71 71 2 63 52 8 7 83 64 27 24 The difference between the max value 94 and the man value 2 92 Do you want to continue (Y/N) y The array elements are

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!