Prepare a new int variable and inititialize it to be a new


Program: public static int[] random(int size, int min, int max)

This method takes three integers and then creates and returns a new int array with size given by the size argument and filled with random values in the range [min, max].

Prepare a new int[] variable and inititialize it to be a new int array with the given size to create random values use the random class import javautil.random inside the method create a new instance with: Random rand = new Random();

The loop through the indexes of the array you created and fill them with a random number between min and max to generate a random number between min and max use random.nextINt(max-min+1) + min

Return now to the filled in array after the loop, to return an array, just return the name of the array, like for all the other variables.

You have to create and return a new int array with size. I am stuck on how to put the dashes in correctly.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Prepare a new int variable and inititialize it to be a new
Reference No:- TGS0960553

Expected delivery within 24 Hours