Question: Write a C++ program that computes the tax and tip on a restaurant bill. The program should prompt the user to enter the cost of

Write a C++ program that computes the tax and tip on a restaurant bill. The program should prompt the user to enter the cost of a meal. The tax is computed at 6.75% of the meal cost. Tip is calculated as a percentage of the meal cost inclusive of the tax. Your program should compute the tip at 15%, 20% and 25% and then output the total amount on the bill for the three different tip amounts. To format the output of your program you will need to use the (stands for I/O manipulation) library.

Observations

For formatting your output you will need to use the functions fixed and setprecision(), available in the library.

- Work on the output formatting part at the end, once you know your program is producing the correct results.

- Give some thought into choosing the right data types for your variables.

- Use named constants where appropriate.

- Document your code. Add comments describing your algorithm. Add comments describing the purpose of the variables you use.

Sample of what your program should looked like Input/Output

Please enter meal cost: 100

The total bill with a 15% tip is $122.76

The total bill with a 20% tip is $128.10

The total bill with a 25% tip is $133.44

Please enter meal cost : 200.00

The total bill with a 15% tip is $245.52

The total bill with a 20% tip is $256.20

The total bill with a 25% tip is $266.88

- Note, the prompt Please enter meal cost: is not part of the input. The prompt is something your program should display on the screen. Also note there is no end-of-line at the end of the prompt.

- Note the blank line between the prompt and the output lines.

- Note the $ signs before the total bill amounts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!