Question: Please use c++ programing. Must output example. Write a program to help a local restaurant automate its breakfast billing system. The program should do the
Please use c++ programing. Must output example.
Write a program to help a local restaurant automate its breakfast billing system. The program should do the following:
a. Show the customer the different breakfast items offered by the restaurant.
b. Allow the customer to select more than one item from the menu as well as multiple items of a particular type.
c. Calculate and print the bill.
Assume that the restaurant offers the following breakfast items (the price of each item is shown to the right of the item):
Plain Egg $1.45
Bacon and Egg $2.45
Muffin $0.99
French Toast $1.99
Fruit Basket $2.49
Cereal $0.69
Coffee $0.50
Tea $0.75
Define a struct, MenuItemType, with two components: menuItem of type string and menuPrice of type double. Use a vector, menuList, of the struct MenuItemType.
Your program must contain at least the following functions:
-
getData: This function loads the data from a file (menu.txt) into the vector menuList. Your program should still work with a different menu.txt file than the one provided. For example if more or less items are added to the menu, or there is a price change.
-
showMenu: This function shows the different items offered by the restaurant and tells the user how to select the items.
-
printCheck: This function calculates and prints the check. (Note that the billing amount should include a 5% tax.)
Example Run
Enter filename: menu.txt(ENTER) Welcome to Johnny's Restaurant Menu 1. Plain Egg $ 1.45 2. Bacon and Egg $ 2.45 3. Muffin $ 0.99 4. French Toast $ 1.99 5. Fruit Basket $ 2.49 6. Cereal $ 0.69 7. Coffee $ 0.50 8. Tea $ 0.75 Enter 0 when you finish your order. Enter the item number: 1(ENTER) How many would you like to order? 3(ENTER) Welcome to Johnny's Restaurant Menu 1. Plain Egg $ 1.45 2. Bacon and Egg $ 2.45 3. Muffin $ 0.99 4. French Toast $ 1.99 5. Fruit Basket $ 2.49 6. Cereal $ 0.69 7. Coffee $ 0.50 8. Tea $ 0.75 Enter 0 when you finish your order. Enter the item number: 2(ENTER) How many would you like to order? 4(ENTER) Welcome to Johnny's Restaurant Menu 1. Plain Egg $ 1.45 2. Bacon and Egg $ 2.45 3. Muffin $ 0.99 4. French Toast $ 1.99 5. Fruit Basket $ 2.49 6. Cereal $ 0.69 7. Coffee $ 0.50 8. Tea $ 0.75 Enter 0 when you finish your order. Enter the item number: 5(ENTER) How many would you like to order? 1(ENTER) Welcome to Johnny's Restaurant Menu 1. Plain Egg $ 1.45 2. Bacon and Egg $ 2.45 3. Muffin $ 0.99 4. French Toast $ 1.99 5. Fruit Basket $ 2.49 6. Cereal $ 0.69 7. Coffee $ 0.50 8. Tea $ 0.75 Enter 0 when you finish your order. Enter the item number: 0(ENTER) Welcome to Johnny's Restaurant SALE 3 Plain Egg $ 4.35 4 Bacon and Egg $ 9.80 1 Fruit Basket $ 2.49 Tax $ 0.83 ----------------------------- Amount Due $17.47
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
