CS46A Fall 19

8A

Complete the class ColoredCircles. A ColoredCircles represents a drawing of circles with 5 rows and 4 columns in random colors. It has a constructor that takes (x, y) location of the upper left hand corner of a set of circles and the diameter of the circles

Use the Ellipse class from the Horstmann graphics.

Provide a constructor that takes the (x, y) coordinates of the upper left hand corner and the diameter of the circles as parameters. Do not draw in the constructor

Provide the methods

Other instructions

Your output for the final will look like this.

output for 8a

For the draft, complete the constructor. Implement the draw method to draw the first row all in red. This is essentially the inner loop. You must use a loop.

8A draft:
8A final:

8B

Create an application called DogList with a main method. In the main method, do the following

Note: You must use an ArrayList and its methods. Do not fake it by just printing the correct strings. You will need to know how to use these methods in a situation where the output can not be faked.

Note1: There is a version of remove method that will remove a specific object. Use that. Here is the code to remove target from the ArrayList called stuff

stuff.remove(target);

Note2: To print an ArrayList in the [xxx, yyy, ...] format, use its toString method like this

System.out.println(stuff.toString());
For the draft,

8B draft:
8B final:

8C

Write an EllipseManager class which manages Ellipse objects.

Use the Ellipse class from the Horstmann graphics library.

The EllipseManager has an instance variable ArrayList<Ellipse>. Call the instance variable list. It has a no-argument constructor (That means it takes no parameters) which initializes an ArrayList of  Ellipses to an empty ArrayList.

Provide these methods

From Google.com:
area of ellipse

Provide Javadoc

For the draft, define the instance variable and implement the constructor. Also implement the add method.

8C draft:
8C final: