Question: 1. Write a Java program using the following methods: A method to fill the array with random numbers: the elements of the array should be
1. 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. .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 (15). The methods should take as input parameters the array and its size. Write a driver program to call these methods and display the difference between the maximum and the minimum element in the array. SAMPLE OUTPUT: 64 84 61 95 1 32 84 9 84 62 94 27 16 26 47 The Maximum element in the array is: 95 The Minimum element in the array is: 1 The Difference between the Max value 95 and the Min value 1-94 28 26 47 60 15 66 7 21 68 60 5 43 46 59 71 The Maximum element in the array is: 71 The Minimum element in the array is: 5 The Difference between the Max value 71 and the Min value 5- 66
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
