Assignment 3
Due: Monday March 7, 2005
Write class definitions for the following objects. Add setter and getter methods for each class.
- Cone. Each cone has a base radius, and a height. Add methods getVolume and getSurfaceArea.
- Cylinder. Each cylinder has a base radius, and a height. Add methods getVolume and getSurfaceArea.
- Sphere. A sphere has a radius. Add methods getVolume and getSurfaceArea.
For each of the above classes, write a separate class in which you prompt the user for data pertaining to the related object, create the corresponding
object, set its properties to the user specified values, and obtain and display its volume and surface area.