Excerpt from Description of Exercise

Objective: To gain experience implementing classes and methods.

The Scenario.

It's almost spring and the flowers will be coming up at any moment. This program will help you prepare for that day. The program will draw and grow flowers like the following:

The canvas should initially start empty. When you click on the canvas, a flower should start growing at that point. Initially it will be just a sprout, but as you drag the mouse around, it should grow. When it reaches its full height, the stem should stop growing and petals should appear. The color for the petals should be chosen randomly. The flower won't grown any more, but if you click on the petals after it has bloomed, the flower will change color. When you are happy with the flower's color, you can grow another one by clicking somewhere else in the window. Your program will be divided into two classes: a window controller called {\tt Spring} and a {\tt Flower} class. We will actually provide the complete code for the {\tt Spring} class. You have to implement the {\tt Flower} class so that it works with our {\tt Spring}.

Handouts Describing the Exercise

Student Resources for Lab Exercise

Sample solutions