10-152-311 - Object-Oriented Programming 1

4.1 Zoo Lab Class Diagram: Overview

In this week's assignments, create a UML class diagram for the Zoo, removing fields, and adding button click handlers and methods as shown below.

4.1 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
    • Guest
    • Wallet
    • Zoo
  2. Enhance your existing UML class diagram (from the completed previous assignment) to include the following changes:
    1. Remove the following fields from the BirthingRoom class:
      1. Baby
      2. Mother
    2. Add these buttons to the MainWindow class:
      1. sallyGiveFred5Button (Sally, give Fred $5)
    3. Add these methods to the MainWindow class:
      1. CalculateTotalAnimalWeight(): double <public>
      2. FindGuest(name: string): Guest <public>
      3. GiveMoney(giverName: string, receiverName: string, amount: decimal) <public>
  3. Using Violet, export the diagram to a .png file (File | Export to | Image file).
  4. Submit the file via Blackboard.