created 01/22/00; revised 12/10/10

# Chapter 36 Programming Exercises

For all of these exercises, use `getWidth()` and `getHeight()` rather than hard-coding width and height into your code. For better looking figures, use `fillCircle()` rather than `drawCircle()` and `fillRect()` rather than `drawRect()` .

## Exercise 1

Write an applet that displays four circles in a square drawing area. Each circle is centered in one of the four quadrants of the drawing area and each circle is a different color.

## Exercise 2

Write an applet that displays a set of three concentric circles of different colors centered in the the applet's drawing area.

## Exercise 3

Draw a quadrilateral that connects the center points of the four edges of the applet.

## Exercise 4

Draw a large asterisk * in the center of the the applet's drawing area by drawing four lines that intersect in the center. (Harder: draw the * using five short lines that radiate from the center of the applet.)

## Exercise 5

Draw an oval that nicely fills the rectangle of the applet.

## Exercise 6

Draw five nested rectangles of various colors.