Programming-Techniques Assignment 4 –Restaurant Managament System Solved

30.00 $

Description

5/5 - (1 vote)

1. Requirements

Consider implementing a restaurant management system. The system should have three types of users: administrator, waiter and chef. The administrator can add, delete and modify existing products from the menu. The waiter can create a new order for a table, add elements from the menu, and compute the bill for an order. The chef is notified each time it must cook food that is ordered through a waiter.

Consider the system of classes in the diagram below.

To simplify the application, you may assume that the system is used by only one administrator, one waiter and one chef, and there is no need of a login process.

Solve the following:

1) Define the interface IRestaurantProcessing containing the main operations that can be executed by the waiter/administrator, as follows:

  • Administrator: create new menu item, delete menu item, edit menu item
  • Waiter: create new order; compute price for an order; generate bill in .txtformat.

2) Define and implement the classes from the class diagram shown above:

• Use the Composite Design Pattern for defining the classes MenuItem, BaseProduct and CompositeProduct

• Use the Observer Design Pattern to notify the chef each time a new order containing a composite product is added.

  1. 3)  Implement the class Restaurant using a predefined JCF collection that is based on a hashtable data structure. The hashtable key will be generated based on the class Order, which can have associated several MenuItems. Use JTable to display Restaurant related information.
    • Define a structure of type Map<Order, Collection<MenuItem>> for storing the order related information in the Restaurant class. The key of the Map will be formed of objects of type Order, for which the hashCode() method will be overwritten to compute the hash value within the Map from the attributes of the Order (OrderID, date, etc.).
    • Define an appropriate collection consisting of MenuItem objects to store the menu of the restaurant.
    • Define a method of type “well formed” for the class Restaurant.
    • Implement the class Restaurant using Design by Contract method (involvingpre, post conditions, invariants, and assertions).
  2. 4)  The menu items for populating the Restaurant object will be loaded/saved from/to a fileusing Serialization.

2. Deliverables

  • A solution description document (minimum 2000 words, Times New Roman, 10pt, Single Spacing) with the structure specified in the Lab Description document.
  • Source files
  • JavaDoc files including the custom tags and descriptions associated to the defined pre,post conditions and invariants
  • jar file required for executing the application
  • restaurant.ser – the file in which the Restaurant object is saved through serializationThe deliverables will be submitted as follows:
  • Create a repository on gitlab with the name:PT2020_Group_LastName_FirstName_Assignment_4
  • Push the following: source code (push the code not an archive with the code), jar file, restaurant.ser file, documentation
  • Share the repository with the user utcn_dsrl.
  • assignment-4-Restaurant-Managament-System-bfklau.zip