10-152-311 - Object-Oriented Programming 1

5.2 Restaurant Assignment: Overview

In this assignment, you will access many of the recently-converted-to-private fields with wrapper methods or properties.

5.2 Restaurant Assignment: 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 5.2  Restaurant 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).

5.2 Restaurant Assignment: Object Diagram

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

PNG image of 5.2 Restaurant UML object diagram

5.2 Restaurant Assignment: Code Snippet

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

// Create dinner menu and store in local variable.

// Create daily lunch special (pot roast) and store in local variable.

// Create lunch menu and store in local variable.

// Add menu items to lunch menu.

// Create Moms.

// Create The Regular.

// Define waitress variable.

// Create waitress (Svanhilde).

// Add Svanhilde to the waitress list.

// Create waitress (Heidi).

// Add Heidi to the waitress list.

5.2 Restaurant Assignment: Sequence Diagram 1

giveHeidi1000RaiseButton

PNG image of the 5.2 Restaurant UML sequence diagram #1

5.2 Restaurant Assignment: Sequence Diagram 2

heidiSeatPatronButton

PNG image of the 5.2 Restaurant UML sequence diagram #2

5.2 Restaurant Assignment: Sequence Diagram 3

prepareDailyFoodButton:

PNG image of the 5.2 Restaurant UML sequence diagram #3

5.2 Restaurant Assignment: 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 5.2 Restaurant rubric