The applet's drawing area is 300 pixels wide. If there are to be 10 circles, how wide is the area which will be used for each circle?

A good answer might be:

300/10

Dividing up the Drawing Area

That was an easy question, but an important one, conceptually. The problem we have to solve is now (almost): "How do you draw a circle in an area?" We know the answer to that.

Here is a picture of the situation (done as a *.gif file, so it should be printable.) The drawing area has been divided up into ten sections. Each section will (when we draw it) get a red circle. The center of each circle will be on the central horizontal line.

The lines are here just for visualization; they will not be in the final picture. The picture shows 10 squares across the center of the drawing area. A call to drawOval() with approriate parameters can put a circle in each square. The left edges of the squares are at

X=0, 300/10, 2*(300/10), 3*(300/10), . . . . 9*(300/10)

We have not yet decided how big the circles are to be. Let us say that they are to completely fill each of the ten squares, so that each circle will have a "width" and "height" of 300/10.

QUESTION 12:

The drawing area has a height of 150. What is the Y coordinate of the top of all the squares?