go to previous page   go to home page   go to next page

Answer:

A cone and a cylinder.


Class Tree

All a simple tree needs is a cone for the branches and a cylinder for the trunk. You probably also want x, y, and z for the location of the tree. Color information might be nice, but let's add that later.

Class Cone was created in chapter 47. Assume you have that code available. Class Cylinder is almost the same. Assume it also is available.


QUESTION 3:

What two attributes (instance variables) is a Cylinder object likely to have?


go to previous page   go to home page   go to next page