Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Assignment1B: Tipping Etiquette: It is customary in the United States to include a tip when purchasing a meal (or having one delivered). Recommendations for

C++

image text in transcribed

Assignment1B: Tipping Etiquette: It is customary in the United States to include a tip when purchasing a meal (or having one delivered). Recommendations for how much of a tip vary depending on who you ask, but the general range is somewhere between 10% on the low end and 20%. Since not everyone is great at calculating in their head, we're going to build a small program to show us the price with either a 10% or 20% tip applied. You will prompt the user to enter the following information: Total Price of the Meal Tax Rate (as a decimal value, not percentage) Delivery Fee You will store these values in appropriate variables, and use them to produce the following intermediate values: Total Tax (Total Price of the Meal * Tax Rate) Subtotal (Total Price of the Meal + Delivery Fee) 10% Tip (Subtotal * 10%) 20% Tip (Subtotal * 20%) Total, 10% Tip (10% Tip + Subtotal + Total Tax) Total, 20% Tip (20% Tip + Subtotal + Total Tax) You will then print the results to the user. A sample output from this program is as shown below, with user input in bold. Your program's output must match this format, but it should work for any valid user input. Call the file Assignment1B (with a file extension of.cpp, .cs or .java) Sample Output: [Tip Calculator] Enter the total price of the meal: 20.50 Enter the local tax rate: 0.06 Enter the delivery fee: 3.99 A 10% tip would be $2.449 The total would be $28.169 A 20% tip would be $4.898 The total would be $30.618 Note: As with Assignment1A, don't worry how many decimal places you have at this point (as long as the number is correct). We will cover rounding in a future lesson

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions