Class Assignment # 5A

Classes and Objects

Due Date Thursday, May 6, 2004

Your task is to write a program that asks the user to input the radius and height of a cylinder and then output its surface area and volume. You must allow the user to enter as many inputs as he wants and quit the program by entering -1. Your program should have two classes; Cylinder and CreateCylinder. Use a constructor in your Cylinder class to initialize the variables with user input.

Evaluation:

Documentation                                                                       /3
    - make sure your initial comments are on each class                          
    - each method should be commented as to purpose

Class definition                                                                      /5
    - access control to variables
    - constructor definition
    - methods for surface area and volume
   

Use of While loop                                                                  /4

Correct Output of Test Case                                                   /3

Total                                                                                     /15

 

Hosted by www.Geocities.ws

1