Write a Java program that does the following: a. Creates a…
Write a Java program that does the following: a. Creates a method called generateRandomArray that takes an integer size as input and returns an array of that size, filled with random integers between 1 and 100 (inclusive). b. In the mainmethod, call generateRandomArray to create an array of size 10. c. Create another method called findMinAndMax that takes an integer array as input and prints the smallest and largest numbers in the array. d. In the main method, pass the generated array to the findMinAndMax method to display the result. At the end of the program, print “Process completed successfully” after showing min and max values. Example Output (will vary due to randomness): Generated Array: [45, 87, 23, 65, 12, 98, 5, 76, 34, 55] Smallest number: 5 Largest number: 98
Read Details