This is for a c++ class Write a program that will be used as an app to help users compute the tax and tip on a restaurant bill. The program should first ask the user to enter the charge for the meal. The program should then prompt the user whether the meal is in-restaurant "restaurant" or whether it will be carry-out "carry-out." If a meal is in-restaurant, it is taxable and should be taxed. The California tax rate is 7.25 percent so you will need to add that much of the meal charge if the meal is in-restaurant. The program should then prompt the user on whether the service was excellent ("Excellent"), good ("Good"), or typical("Typical"). The tip should be then be 30 percent, if service was excellent, 20% if it was good, or 15% if it was typical. Note that the tip is computed based on the subtotal (before tax if applicable). Display the meal charge, the type of order (in-restaurant or carry-out), tax amount if applicable, tip amount, and total bill on the screen. Example input: "restaurant" and "Good" Example output: In-Restaurant Meal Subtotal: $38.55 Tax: $2.79 Tip: $7.71 Total: $49.05
This is for a c++ class
Write a
Example input: "restaurant" and "Good"
Example output:
In-Restaurant Meal
Subtotal: $38.55
Tax: $2.79
Tip: $7.71
Total: $49.05
Declare variables to hold the meal charge, type of meal, and type of service respectively.
float bill;
std::string type;
std::string service;
Declare other variables to hold the computed values of tax, tip, and total.
float tax;
float tip;
float total;
Prompt the user for the charge of the meal, type of meal, and type of service, and store the values in the respective variables.
Based on the user input, compute the values for tax (if applicable), tip, and total bill to be paid by the customer.
Lastly, display all the details including the type of meal, meal charge, tax, tip, and the total bill amount.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images