Question: Object Oriented Programming Java Programming Exercises 2023 [Question1] Rreverse an array Write a program that reverses a random generated integer array. You shoulde define 3
![Object Oriented Programming Java Programming Exercises 2023 [Question1] Rreverse an array](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66efc0f270662_52966efc0f1e03a5.jpg)
Object Oriented Programming Java Programming Exercises 2023 [Question1] Rreverse an array Write a program that reverses a random generated integer array. You shoulde define 3 methods: 1. Method int [] createArray () The purpuse of this method is to generate 20 integer numbers randomly between ( 0 and 100) and assigns them to an array. - The created array must be returned in order to reverse it by the second method. - You can obtain a random integer numbers by using nextInt () method in the Random class. - You should pass the upper bound to the nextint () method to generate values in the specified range. Example: int [] X= new int [1]; Random rd = new Random(); // generates random numbers in the range 0 to 99 x[0]=rd. nextInt (100); 2. Method int [] reverseArry (int [] oriqinalArray) The purpuse of this method is to reverse the passeed array and return it after reverse. 3. Method displayArray(int [] arraytoDisplay) This method accept an array and display it. Write a test program that call createArray() method to generat a random array of integers, then pass it to the reverseArray() method, and display the reverserd array by calling the reverseArray() method. Here is the sample run of the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
