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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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

Expert Solution
Step 1

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

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY