CS504 Fundamentals of Research
Assignment #7
Due: Wednesday, March 7th.
For this assignment the goal is to extend the pet class with the
following additions (some of these we will be doing on Friday):
- Add a new data member to the class. This can be something like
happiness or health or sleepiness or species.
- Change the constructor (the __init__ function) to set the
value of the new variable.
- Change the constructor (the __init__ function) to allow the user
to pick their pet's color. (Or assign the pet a random color.)
- Change the print() function to print the new variable you created.
- Create at least three functions that allow the player to interact
with their pet. Functions like play(), feed(), etc. These functions should
change the pet's variables. For example, if you include a feed() function
it should make the pet less hungry (and maybe more sleepy).
-
Create a function that loops repeatedly allowing the player to pick how
to interact with their pet. This is similar to the start() function
in the adventure game, but the loop should begin by asking the player how
they want to interact with their pet and then select that action/function.
Turn in: The code
and sample output for your python project.