10-152-311 - Object-Oriented Programming 1

2.2 Zoo Lab Class Diagram: Overview

In this week's assignments, create a UML class diagram for the Zoo's information given below.

2.2 Zoo Lab Class Diagram: Directions

  1. Using the previous lab class diagram as a starting point, add/remove classes (by "folding in" any fields as appropriate) such that the following classes (and their contents) are displayed:
    • MainWindow
    • Animal
    • BirthingRoom
    • Food
    • VendingMachine
    • Zoo
  2. Enhance your existing UML class diagram (from the completed previous assignment) to include the following changes:
    1. Add a class "Animal" with the following fields:
      1. Age (int)
      2. IsPregnant (bool)
      3. Name (string)
      4. Type (string)
      5. Weight (double)
    2. Add these fields to the existing BirthingRoom class:
      1. Baby (Animal)
      2. Mother (Animal)
    3. Add a class "Food" with the following fields:
      1. BestIfEatenBy (string)
      2. Type (string)
      3. Weight (double)
    4. Add these fields to the existing VendingMachine class:
      1. DingoFoodPortionWeight (double -- readonly)
      2. PlatypusFoodPortionWeight (double -- readonly)
      3. DingoFood (Food)
      4. DingoFoodMaxStock (double)
      5. DingoFoodPrice (decimal)
      6. DingoFoodStock (double)
      7. PlatypusFood (Food)
      8. PlatypusFoodMaxStock (double)
      9. PlatypusFoodPrice (decimal)
      10. PlatypusFoodStock (double)
  3. Using Violet, export the diagram to a .png file (File | Export to | Image file).
  4. Submit the file via Blackboard.