Question: Please use Java Problem 3. Process array (ProcessArray.java) Descriptions: Write a Java class named ProcessArray that can insert new elements or delete elements from a

Please use Java
Please use Java Problem 3. Process array (ProcessArray.java) Descriptions: Write a Java

Problem 3. Process array (ProcessArray.java) Descriptions: Write a Java class named ProcessArray that can insert new elements or delete elements from a given array. This class will include the following methods: 1) insert(): this method has two parameters: the first one is an integer array, and the second one is an integer type parameter indicating a number that will be added to the array. This method will return an updated integer array. 2) delete(): this method has two parameters: the first one is an integer array, and the second one is an integer type parameter indicating a number that will be deleted from the array. The method will return an updated integer array. 3) display(): this method has one parameter which is an integer array. It will display each element in the array. 4) main() method: Generate an integer array of length 10, and each element is a random number within the range of 1 through 50. Ask the user to enter a number, and add this number into the array. Display the new array Ask the user to enter a number, and remove all the appearances of that number if there is any from the array. Display the new array. Hint: To insert a number into an array, you can create a new array with increased size, and add that number at the end of the new array. To delete a number from an array, you can create a new array with reduced size, and copy all the numbers in the old array that are not equal to the deleted number into the new array. Outputs: Sjava ProcessArray The array is: 2 3 10 40 24 42 8 6 5 3 Please enter a number to be added into the array: The updated array is: 2 3 10 40 24 42 8 6 5 3 Please enter a number to be deleted from the array: 3 The updated array is: 2 10 40 24 42 8 6 5 %

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!