
10-152-311 - Object-Oriented Programming 1
6.1 Zoo Lab Class Diagram: Overview
- Modify the Violet UML class diagram contained withing this 6.1 Zoo Class Diagram starting zip file, following these specifications:
- Remove the following classes from the diagram, by "folding them in" to the classes which reference them, as appropriate:
- Food
- Restroom
- Guest
- Wallet
- Booth
- BirthingRoom
- Employee
- Change animal type parameters from "string" to "Type":
- Zoo.FindAnimal (3)
- VendingMachine.LookupFoodPrice()
- Remove the "type" parameter from both Animal constructors.
- Remove the "type" field from the Animal class.
- Remove the "type" property from the Animal class.
- Create a Mammal descendant class of Animal and Dingo and Platypus descendants of Mammal:
- Connect them to their base classes using an "inherits from" (is-a) connecting line.
- Add a constructor to each class, with three parameters: age (int), name (string), and weight (double).
- Move animal-specific methods down from the Animal class to the appropriate descendants:
- Dingo: Bark(), BuryBone(), and DigUpAndEatBone().
- Platypus: ShowAffection().
- Using Violet, export the diagram to a .png file (File, Export to | Image file).
- Submit the file via Blackboard.