CS120
Lab #6
Due at the end of lab.
For this assignment you will be modifiying the pet program from the text.
A copy of the complete pet program is available from the course schedule. Pay careful attention
to how the data and the functions in the pet object are accessed. The dot notation being used
is very similar to the notation used in strucutres (e.g. player1.health).
- Add more interactive output text when the user
plays with their pet (similar to the "MMM Yummy" message when a pet is fed).
- Change the feed() member function so that
the player has several options of what to feed their pet. For example,
treats, which increase happiness, but don't effect hungry much, or normal food,
which lowers hunger, but doesn't effect happiness much.
- Give pets a species type. Add a new data
member that stores the type or species of the pet. The new data member
should be of type string like the name data member. The new data member
should be added around lines 7-9, where the other data members are
declared. In addition, the user will need to enter the type of the pet
as part of the constructor member function (lines 2b-7b) and the print()
member function should print each pet's type (around line 34b).
Turn in: A copy of the program and sample output showing it runs.
In the sample ouput make sure you show that you've tested all of the
new functionality of the program.