Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop a menu-driven C++ program for food purchases at a Greek restaurant. The main program will loop allowing the user to select food items from

Develop a menu-driven C++ program for food purchases at a Greek restaurant. The main program will loop allowing the user to select food items from the menu, adding each item to the bill, and terminating when the user selects the "End order" item. The program will then calculate and display the total bill with tax of 6.5% (.065) and tip of 20% (.20); tip is calculated on the pretax bill. The program also needs to collect payment and calculate change due.

Tax rate and tip percent should be declared as constants in main.

The program should validate that the user has entered a valid menu selection and that the amount tendered is enough to cover the bill.

Requirements:

1.Functions :

  • Define a void function without parameters to display the food menu and prices
  • Define a function which accepts the bill (sum of menu items), tax rate and tip percent, then calculates and displays the bill, tip amount, tax amount, and total bill, and returns the total bill via the function's return type.
  • Define a void function with 2 parameters (totBill, amtTendered) to calculate and display the change due

2.Global variables may not be used. All variables used in functions must be local and passed by parameters or declared locally in a function.

3.Program must be menu-driven (see menu below)

4.Input validation for menu item choice and amount tendered.

5.Verify that the customer tendered an amount that is equal to or greater than the total bill.

6. Display 2 decimal points for all dollar amounts and decimal points must line up.

in the second function, after calculating the final bill, return to main the tip amount, tax amount, and final billvia reference variables, and display the required bill amounts in main.

I'm confused. I need help!

Use the following items for the menu:

Greek Islands Menu

1 - Gyro $7.00

2 - Moussaka$8.50

3 - Salad$3.75

4 - Dolma$2.00

5 - Soda$2.80

6 - Coffee$1.00

7 - Water$2.00

8 - End order

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions