Task: Using C++, create a restaurant order management program that meets the following requirements:
1) The user can create up to 10 orders
2) Each order has its own ID, contains the name of the server who took the order and the date and time it was taken
3) Each order contains up to 20 items
4) An item can be food or drink and each one has at least a name and a base price
5) The different kinds of food the restaurant has is an appetizer, entree or dessert
6) An appetizer can be free (base price not applied at order)
7) An entree is either classified as beef, poultry, seafood or vegetarian with an optional side dish
8) A side dish is either potatoes or salad and has its own custom price established at the time of the order
9) A dessert can feed between 1-4 people (base price stays the same regardless of number of people)
10) Drinks are either alcoholic or nonalcoholic
11) Alcoholic drinks have a 5% added tax added to its base price
12) Nonalcoholic drinks are refillable and the restaurant wants to track how many refills are requested on an order The program starts with a menu to ask the user to create an order, close order and print receipt, display order summary and exit program.
The menu options are handled as follows: 13) When creating an order, the program asks for the server name, date and time of order. The order is automatically considered open and the user then enters all items as appropriate for the order. When finished, the program assigns and shows its order ID and then returns to the main menu
14) When closing an order and printing a receipt, the program shows all the open orders by ID and server name and asks the user which one to close. The user enters the ID of the order to close and after doing so, the order is considered closed and all items with their prices and the final total of the order is displayed. The program then returns to the main menu
15) When displaying order summary, show the following data: number of orders that are currently open and closed, counts of each item type ordered from all orders, how many free appetizers have been ordered, how many people are fed from all desserts ordered, and total price of all orders placed. The program then returns to the main menu
Programming requirements: You must come up with your own class design and demonstrate use of inheritance and polymorphism in this assignment. There may be opportunities to use composition as well, but you are not required to use that in this assignment.
#include
#include using namespace std; // Function Prototypes void showMenu(); void showFees(double, int); int main() { int choice; //To Hold Menu Choice double quantity = 1; //contants for menu choices const int hamburgerChoice = 1; const int hotdogChoice = 2; const int peanutsChoice = 3; const int popcornChoice = 4; const int sodaChoice = 5; const int chipsChoice = 6; const int waterChoice = 7; const int endOrderChoice = 8; //constants for menu prices const double hamburger = 6.00; const double hotdog = 4.50; const double peanuts = 3.75; const double popcorn = 5.50; const double soda = 2.80; const double chips = 1.00; const double water = 2.00; //set precision cout << fixed << showpoint << setprecision(2); do { //display menu and get user choice showMenu(); cin >> choice; //validate choice while (choice < hamburgerChoice || choice > endOrderChoice) { cout << \"Please enter a valid menu choice: \"; cin >> choice; } //if the user does not want to quit proceed if (choice != endOrderChoice) { //display fees switch (choice) { case hamburgerChoice: showFees(hamburger, quantity); break; case hotdogChoice: showFees(hotdog, quantity); break; case peanutsChoice: showFees(peanuts, quantity); break; case popcornChoice: showFees(popcorn, quantity); break; case sodaChoice: showFees(soda, quantity); break; case chipsChoice: showFees(chips, quantity); break; case waterChoice: showFees(water, quantity); break; } } } while (choice != endOrderChoice); system(\"pause\"); return 0; } //************************************************************* //Definition of function showMenu which displays the menu ** //************************************************************* void showMenu() { cout << \"\ \\t\\tBaseball Game Snacks\" << endl; cout << \"1. Hamburger \\t$6.00\"<< endl; cout << \"2. Hotdog \\t\\t$4.50\" << endl; cout << \"3. Peanuts \\t\\t$3.75\" << endl; cout << \"4. Popcorn \\t\\t$5.50\" << endl; cout << \"5. Soda \\t\\t$2.80\" << endl; cout << \"6. Chips \\t\\t$1.00\"<< endl; cout << \"7. Water \\t\\t$2.00\" << endl; cout << \"8. END ORDER\" << endl; cout << \"Please enter your menu choice: \"; } //************************************************************ //Definition of function showFees which caculates the total ** //bill ** //************************************************************ void showFees(double itemCost, int quantity) { double amtTendered; double totalBill = (itemCost * quantity); double taxRate = .065; double tipRate = .20; double tip = (totalBill * tipRate); double tax = (totalBill * taxRate); double amountDue = (totalBill + tax + tip); cout << \"Total Bill: $\" << totalBill << endl; cout << \"Tax: $\" << tax << endl; cout << \"Tip: $\" << tip << endl; cout << \"Total Amount Due: $\" << amountDue << endl; cout << \"Enter ammount tendered: $\"; cin >> amtTendered; double changeDue = amtTendered - amountDue; cout << \"Change Due: $\" << changeDue << endl; }