CS 1063  Introduction to Computer Programming  Project 1 
The Pet Class

        

Objectives

Hand-in Requirements

All projects and laboratories will be submitted electronically through webCT. Zip up your entire project directory to submit as the source. (Right click on the project folder and follow the SentTo link.) The project directory should include the following:

Details

    1.  Write a class named Pet that has the following data fields:

 

    2.  In addition, the class should have the following methods:

 

    3.  Test your class by doing each of the following:

    1. Instantiate a Pet object p1 using “Willie”, “Dog” and 4
    2. Print all of the values stored in the private data with a label
    3. Call the method ageAnimal 2 times
    4. Print the age of p1 with a label
    5. Set the name of the dog to “Willy”
    6. Print the name of p1 with a label


Last revision: February 6, 2004 at 4:55 pm