10-152-311 - Object-Oriented Programming 1

7.1 Zoo Lab: Overview

In this lab we will be implementing interfaces and adjusted our existing code to make use of them.

7.1 Zoo Lab: Class Diagram

Implement the changes specified in the following UML class diagram.

Create any button(s) and button click event handler(s) in the WPF window designer (if specified in the class diagram).

PNG image of 7.1  Zoo UML class diagram
  1. When creating classes be sure to:
    1. Ensure the class in the root namespace. This can be done in one of two ways. Either by adding the class in the project, i.e. scenario, or by adding the class to the business classes folder and removing the ".Business_Classes" designation from the namespace.
  2. Open the main window (MainWindow.xaml) in designer mode (right-click and click "View Designer" or press Shift-F7 to go to designer mode).

7.1 Zoo Lab: Object Diagram

Instantiate the objects and set their field values as specified in the following UML object diagram.

PNG image of 7.1 Zoo UML object diagram

7.1 Zoo Lab: Code Snippet

Within the newZooButton click event handler use the following code snippet as your guide to writing the code.

// Create Sam.

// Create the Como Zoo.

// Set birthing room temperature.

// Add Sam to the zoo.

// Create Flora.

// Add Flora to the zoo.

// Create Brutus and add him to the zoo.

// Create Coco.

// Make Coco pregnant.

// Add Coco to the zoo.

// Create Paddy and add him to the zooPatti.

// Make Patti pregnant.

// Add Patti to the Como Zoo.

// Create Bella.

// Make Bella pregnant.

// Add Bella to the zoo.

// Create Buzz and add him to the zoo.

// Create Sally and add her to the zoo.

// Create Fred and add him to the zoo.

7.1 Zoo Lab: Sequence Diagram 1

fredFeedPlatypusButton

PNG image of the 7.1 Zoo UML sequence diagram #1

7.1 Zoo Lab: Sequence Diagram 2

floraBirthDingoButton

PNG image of the 7.1 Zoo UML sequence diagram #2

7.1 Zoo Lab: Sequence Diagram 3

floraBirthPlatypusButton:

PNG image of the 7.1 Zoo UML sequence diagram #3

7.1 Zoo Lab: Final Steps

Test, Complete and Submit

  1. Build your program - Eliminate compiler errors and warnings
  2. Debug/Test your program - Set breakpoints, step through code, monitor values
  3. Make your code StyleCop-compliant
  4. Close your Visual Studio solution.
  5. Compress your Visual Studio solution to a zip file.
  6. Submit the zip file via Blackboard.

Grading Rubric

PNG image of the 7.1 Zoo rubric