Object-Oriented Programming 1: 6.1 Restaurant Assignment
- Drink class
- Define Drink class
- Check your work: Build the solution and ensure that the code compiles without errors or warnings.
- ColdDrink / Lemonade
- Define ColdDrink class which inherits from Drink.
- Check your work: Build the solution and ensure that the code compiles without errors or warnings.
- Define Lemonade class which inherits from ColdDrink.
- Check your work: Build the solution and ensure that the code compiles without errors or warnings.
- Revise FoodItem for inheritance
- Remove the type field and the constructor from the FoodItem class.
- Update the cook's MakeFoodItem method to no longer pass a string into the FoodItem constructor.
- Define a local variable for the food item to be instantiated.
- Check your work:
- Run the application.
- Click the buttons to seat and serve lunch to the regular.
- Note that the null FoodItem is not added to the Ticket's list due to validation efforts in week 4.2.
- Add Type Calculated Property
- Return this.GetType().Name
- Check your work: Build the solution and ensure that the code compiles without errors or warnings.
- Within the Cook's MakeFoodItem method, if the menu item is lemonade then create an instance of the Lemonade class.
- Check your work:
- Set a breakpoint in the server's TakeAndFillOrder method.
- Run the application.
- Click the buttons to seat and serve lunch to the regular.
- Ensure that lemonade and meatloaf objects are instantiated and served to the regular.
- HotDrink / Coffee
- Define HotDrink class which inherits from Drink
- Check your work: Build the solution and ensure that the code compiles without errors or warnings.
- Place method calls as specified in the sequence diagram.
- Define Coffee class which inherits from HotDrink.
- Check your work: Build the solution and ensure that the code compiles without errors or warnings.
- Within the Cook's MakeFoodItem method, add a condition for a Coffee object.
- Check your work:
- Run the application
- Meal / CookedMeal / Meatloaf
- Define Meal class as specified in the class diagram.
- Check your work: Build the solution and ensure that the code compiles without errors or warnings.
- Define CookedMeal class as specified in the class diagram.
- Check your work: Build the solution and ensure that the code compiles without errors or warnings.
- Define Meatloaf class as specified in the class diagram.
- Check your work: Build the solution and ensure that the code compiles without errors or warnings.
- Place method calls as specified in the sequence diagram.
- Within the Cook's MakeFoodItem method, add a condition for a Meatloaf object.
- Check your work:
- Run the application
- PotRoast
- Define PotRoast class as specified in the class diagram.
- Check your work: Build the solution and ensure that the code compiles without errors or warnings.
- Place method calls as specified in the sequence diagram.
- Within the Cook's MakeFoodItem method, add a condition for a PotRoast object.
- Check your work:
- Run the application
- UncookedMeal / TurkeyClub
- Define classes as specified in the diagram.
- Within the Cook's MakeFoodItem method, add a condition for a TurkeyClub object.
- Check your work:
- Run the application
- Submit