Question: 3 pts ) Add another constructor to this class such that it takes three parameters, a ) an int for the length of the numbers

3pts) Add another constructor to this class such that it takes three parameters, a) an int for the length of the numbers array, b) another int for the length of the boxes array, and c) a String type array to initialize the listOfNames array. The constructor instantiates numbers and boxes to the given parameters as lengths and assigns the third parameter to the String array. Choose your own IDs for the parameters. The constructor calls the loadNumbers() and loadBoxes() methods (see below).4.(3pts) Define the loadNumbers() method. The task of this method is to populate the numbers array with randomly selected integer numbers from the range -100 to 100. Decide about the return type and parameters as you see it best. The method must run a for loop to the length of the array and assign a random number one by one to the array entries. 5.(3pts) Define the loadBoxes() method. The task of this method is to populate the boxes array with Rectangles. Decide about the return type and parameters as you see it best. The method must run a for loop to the length of the array. For every index k, a Rectangle object is instantiated w

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 Programming Questions!