Question
Imagine that you are writing a simulation of a restaurant to help make decisions about number of employees, ensure appropriate crowding levels both in the
Imagine that you are writing a simulation of a restaurant to help make decisions about number of employees, ensure appropriate crowding levels both in the restaurant and kitchen, etc.
The restaurant employs chefs, waiters, and hosts. The restaurant also has an owner.
Employee pay is calculated using a different algorithm based on the type of employee. Waiters also receive tips. The owner doesn't get paid hourly ... she owns the business.
Parties of customers are categorized as walk-in, reserved, and celebrity parties
A party has a size (number of people).
A party will be matched to a table (we'll assume 1 party per table).
A party has a time that they will take to order and also a time they will take to eat/pay/exit.
All parties tip, and the algorithm for calculating the tip is based on their category (celebrities generally tip 25% + a constant amount while walk-ins usually tip 15% for other parties of 2-3 people, 18% for parties of 4 or more, etc.).
Each waiter has a list of tables he/she is assigned to wait on.
Each chef has a different skill level allowing them to cook the order faster (higher skill) or slower (lower skill).
Each chef has a queue of orders they are assigned to cook.
Waiters take orders from a particular table, enter the kitchen, give the order to a chef (don't worry about how they choose the chef), who indicates how long it will take and then the waiter returns to the dining area. The waiter will return to the kitchen to get the order after that time as elapsed.
The restaurant should support the following operations:
Return a list of all the employees.
Compute the gross amount of money/pay employees earned by iterating through the list of all employees
At any particular time, indicate how many customers a waiter is serving.
Note: You don't have to worry about how time would "increase" or "pass", nor do you have to worry about the overall coordination of who calls the higher level functions. Just consider the objects and member functions necessary to support appropriate invocation of the described functionality.
Diagram the classes involved from the description given. Indicate which classes are abstract, and which aren't. Show which classes inherit from each other with an arrow and label it as public or private. Also show which classes have a "has-a" relationship to another class and indicate what container class (if any) would be used to store them (e.g., lists, sets or maps where appropriate).
You should identify the key virtual functions (and whether they are pure virtual functions). Also, identify the data members of a class insofar as they indicate "has-a" relationships.
For this problem, you can choose to draw this by hand and scan it (and submit as a JPG or PDF), or to use some graphics software (and produce a JPG or PDF), or to use UML (if you know it), or draw it using ASCII art (this may be a lot of work). Provide an explanation with your choices, i.e., tell us why you chose to have certain classes inherit from each other (or not inherit). Notice that you don't need to do any actual programming for this problem.
Of course, there isn't just one solution, but some solutions are better than others. Just do your best to write a class hierarchy, define member functions, and identify uses of composition and data structure members to support the description above. Good explanations may help you convince us that your proposed approach is actually good.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started