Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in Java Assignment1B: Tipping Etiquette: It is customary in the United States to include a tip when purchasing a meal (or having one delivered). Recommendations
in Java
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 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started