Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Language: C++ Sample configuration file (config.txt) Tables: table #, max seats

ID: 3817472 • Letter: L

Question

Language: C++

Sample configuration file (config.txt)

Tables: table #, max seats

1 2

2 4

3 2

4 2

5 2

6 4

7 6

8 10

9 2

10 4

11 4

12 4

13 4

14 2

15 2

16 2

17 2

18 2

Menu:     listing of the full menu: item code, name, price

A1 Bruschetta 5.29

A2 Caprese_Flatbread 6.10

A3 Artichoke-Spinach_Dip 3.99

A4 Lasagna_Fritta 4.99

A5 Mozzarella_Fonduta 5.99

E1 Lasagna_Classico 6.99

E2 Capellini_Pomodoro 7.99

E3 Eggplant_Parmigiana 8.99

E4 Fettuccine_Alfredo 7.49

E5 Tour_of_Italy 14.99

D1 Tiramisu 2.99

D2 Zeppoli 2.49

D3 Dolcini 3.49

S1 Soda 1.99

S2 Bella_Limonata 0.99

S3 Berry_Acqua_Fresca 2.88

Sample activity file (activity.txt):

1 P2   // Party of 2 is assigned to Table 1

2 P4

4 P2

1 O A1 A1 E1 E2   // Party at table 1 orders these items

8 P10

1 S // Food arrives at table 1

3 P2

1 C // T1 gets the check, pays and leaves & table is cleaned too.

5 P2

1 P1 // Party of 1 is assigned to table 1

In addition to processing these commands, when a table is closed, display the check as well. Include table #, # of customers in the party, name and price of each ordered item and the total. No need to worry about tax or tips.

Error checking:

- Do not allow orders from table with no party assigned to it.

- Do not allow assigning new party to a table when another party is already there.

- Do not allow check-out from empty table or a table in which food has not been served.

- Do not allow delivery of food to an empty table!

- Do not assign a party to a table with insufficient # of chairs.

- Reject any request that does not match with sample formats.

This assignment mimics the configuration and activities happen at a typical restaurant. Input is provided in 2 files: config.txt and activity txt. Configuration file contains how many tables, table waiter relationship & full menu list. Activity file mimics the actual activities that happen in restaurant. After setting up the necessary objects using the configuration file, you can read the activity file and process them. Do not use vector or any other template in this assignment. We will use the following classes to complete this assignment. Feel free to add more variables if needed. Avoid making drastic changes to existing variables. You need to define the classes and implement all the .cpp files including class implementation and overall application functionality. Table status, of max seats, of guests if a party is seated, order if the party has ordered Menu Item: itemCode, name, price Menu array of MenuItems Order a list of menu items ordered at a table

Explanation / Answer

//main.cpp

=========================================================================

//Menu.cpp

===========================================================================

//Menu.h

======================================================================

//MenuItem.cpp

==========================================================================

//MenuItem.h

=======================================================================

//Order.cpp

======================================================================

//Order.h

========================================================================

//Restaurant.cpp

==============================================================================

//Restaurant.h

==============================================================================

//Table.cpp

===========================================================================

//Table.h

============================================================================

//Tokenizer.cpp

===================================================================================

//Tokenizer.h

============================================================================

//Waiter.cpp

=============================================================================

//Waiter.h

======================================================================