8A
Complete the class XGrid. An XGrid has a x,y location of the upper left hand corner. It represents a grid of X's with 4 rows and 5 columns in random colors
You are given a class X which represents a graphical X and that can draw itself at a specified location in a specified color. You can look at its documentation to see the details.
Provide a constructor that takes the x, y coordinates of the upper left hand corner as parameters. Do not draw in the constructor
Provide the method
draw() which draws 4 rows each containing 5 X objects. Each X is drawn in a random color either red, blue, green or black. You will write and call a getRandomColor method to figure out the color to use. Iterate through the rows in the outer loop and through the columns in the inner loop.getRandomColor() gets a random color either Color.RED, Color.BLUE, Color.GREEN, Color.BLACK. You are provided with a Random object. Use it and do not change the seed. Generate a random integer 0 to 4 and use the constants defined in the XGrid class to determine the color. For example if the random number is RED (0) the method will return Color.REDOther instructions
Your output for the final will look like this.

For the draft, provide the instance variables and complete the constructor. Implement the draw method to draw the first row all in red. You must use a loop.
8B
Complete the class Vocab which has an arraylist of strings as an instance variable and methods to act on the array list. Call the instance variable words
Provide a constructor that takes a ArrayList<String> as a parameter and assigns it to the instance variable
Provide methods:
longest() gets the longest word or null if the array list is emptyaverageLength() gets the average length of the words in the array list or 0 if the arraylist is emptyremove(String target) removes all occurrence of the given wordtoString() returns a string representation of this Vocab object (already done for you)Note: There is a second version of the remove method that will be helpf ul: to remove a specific object named target
words.remove(target);
Provide Javadoc
For the draft, provide the instance variable and the constructor. Implement the other methods as stubs (including Javadoc)
8C
Complete the class PhotoAlbum which manages an ArrayList of Pictures. This is a little different than the videos because we are encapsulating the ArrayList in a class and providing methods to process the list
Provide a constructor that initializes the instance variable with an empty array list. Call the instance variable photos so that the draw method will work
Provide methods
add() which adds a Picture object to the PhotoAlbumtotalArea() gets the sum of the areas of all the Pictures in this PhotoAlbumlargest() gets the Picture with the largest area. If more than one picture has the same ares, return the first.area() to get the area of a Picture and use it in the implementation of total Area() and largest()Provide Javadoc
For the draft, provide the instance variable, the constructor, and the add method. Implement the other methods as stubs
The pictures are in this zip, oliver_pics.zip. Download, unzip, and put the pictures in the Bluej project folder