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

Answer:

You would expect:

Any other attributes of a cone can be calculated from these two.


Instance Variables of the Cone class

Right Circular Cone

Object oriented design means deciding what classes you need, what data the objects hold, and how the objects behave. Let us do that with the Cone class.

Here is the beginning of our design:



Cone

A class that represents a right circular cone

Variables

Constructor

Methods

. . . . . .


Instance variables (like height) are usually made private so that only the constructors and methods of the object may access them.

Constructors are usually made public.


QUESTION 2:

What parameters should the Cone constructor have? Fill in the blanks.


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