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?

Answer:

300/10

Dividing up the Drawing Area

That was an easy question, but an important one, conceptually. Now we need to determine how to draw a cricle inside each square.

Here is a picture of the situation. Ten squares are lined up along the horizontal center. Each square contains a red circle.

ten circles

The lines are for visualization. They are not in the final picture. A call to drawOval() with approriate parameters draws each circle. If the total width of the picture is 300, then the left edges of the squares are at:

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

Say that each circle will completely fill its square. Then each circle has a width and height of 300/10.

QUESTION 12:

What is the radius of each circle?

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