10-152-312 - Object-Oriented Programming 2

3.1 Zoo Assignment

Starting .zip File.

  1. Unzip the OOP2_3.1Zoo zip file.
  2. Rename the folder, changing "LastName" to your last name.
  3. Open the contained solution (.sln) file and examine the code in preparation for making further changes as specified below.

Getting started

  1. Add buttons to the MainWindow as specified in the wireframe
  2. Add the fields and methods to the MainWindow and Zoo as specified in the class diagram

Zoo

  1. Type the following code in the SaveToFile method:
  2. Type the following code in the LoadFromFile method:
  3. Add using directives as necessary

MainWindow

  1. Initialize the autoSaveFileName to "Autosave.zoo"
  2. Type the following code in the SetWindowTitle method:
    1. You will need to remove the System.Windows.Shapes using directive and add System.IO in order for the call to Path.GetFileName to work correctly
  3. Inside the ClearWindow method, clear both list boxes
  4. Type the following code in the save button's click event handler:
  5. Complete the SaveZoo method as specified in the sequence diagram
  6. Type the following code in the load button's click event handler:
  7. Complete the LoadZoo method as specified in the sequence diagram
  8. Type the following code in the start over button's click event handler:
  9. Inside the window_Loaded event handler:
    1. Remove the existing creation of a zoo
    2. Call the LoadZoo method, passing in the autoSaveFileName
    3. If LoadZoo does not succeed (i.e. it returns false), create a new zoo and store it in comoZoo
  10. Call SaveZoo inside the window_Closing event handler, using the autoSaveFileName as the parameter
  11. Add using directives as necessary

Serializing

  1. Add the [Serializable] attribute to every class that will be serialized (Zoo and all classes it contains)
  2. The following do not need to be or cannot be serialized:
    1. Interfaces
    2. Enumerations
    3. Windows
    4. Console

3.1 Zoo Assignment: Class Diagram

Create/modify the classes as specified in the following UML class diagram.

PNG image of 3.1 Zoo UML class diagram

3.1 Zoo Assignment: Sequence Diagram

saveButton_Click:

PNG image of the 3.1 Zoo UML sequence diagram #1

loadButton_Click:

PNG image of the 3.1 Zoo UML sequence diagram #2

3.1 Zoo Assignment: Console Command Diagram

Implement console commands per the following diagram.

PNG image of 3.1 Zoo console command diagram

3.1 Zoo Assignment: Wireframe

Design the user interface per the following diagram.

PNG image of 3.1 Zoo wireframe

Grading and Submission

  1. Build/compile your program
  2. Debug/test your program against the following rubric:
  3. PNG image of 3.1 Zoo rubric
  4. Make your code StyleCop-compliant
  5. Close your Visual Studio solution
  6. Compress your Visual Studio solution to a zip file
  7. Submit the zip file via Blackboard