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

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

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!