Question: Java. Write a program that will remove a random integer (between 0-6) from an array containing random integers (between 0-6). This program must use four

Java.

Write a program that will remove a random integer (between 0-6) from an array containing random integers (between 0-6). This program must use four methods to accomplish this:

a. Create a method to build the array of random integers between 0-6. The array must be size 10.

b. Create a method to generate the random integer between 0-6.

c. Create a method called remove(int v, int[] in) that will return a new array of the integers in the given array but with the value v removed. For example, if v is randomly generated as 3 and incontains 0,1,3,4,6,5,3,1,3,6 the method will return an array containing 0,1,4,6,5,1,6.

d. Create a method to print the original array, the number that is to be removed, and the new array.

i.e. The original array contained: 0,1,3,4,6,5,3,1,3,6.

The number requested to be removed is 3.

The new array contains: 0,1,4,6,5,1,6.

Can anyone explain it by writing comment per code line to understand it?

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!