Write a pseudo code that will calculate a XXX% tip and a 6% tax on a meal price.
ID: 3844782 • Letter: W
Question
Write a pseudo code that will calculate a XXX% tip and a 6% tax on a meal price. The user will enter the meal price and the program will calculate tip, tax, and the total. The total is the meal price plus the tip plus the tax. Your program will then display the values of tip, tax, and total.The restaurant now wants to change the program so that the tip percent is based on the meal price. The new amounts are as follows:
Meal Price Range
Tip Percent
.01 to 5.99
10%
6 to 12.00
13%
12.01 to 17.00
16%
17.01 to 25.00
19%
25.01 and more
22%
Meal Price Range
Tip Percent
.01 to 5.99
10%
6 to 12.00
13%
12.01 to 17.00
16%
17.01 to 25.00
19%
25.01 and more
22%
Explanation / Answer
Start
Print "Please Enter Meal Price"
MealPrice = input();
if (MealPrice >=0.01 && MealPrice <=5.99)
tax = 0.06 * MealPrice
tip = 0.1 * MealPrice
total = tax + MealPrice + tip
else if (MealPrice >=6 && MealPrice <=12.00)
tax = 0.06 * MealPrice
tip = 0.13 * MealPrice
total = tax + MealPrice + tip
else if (MealPrice >=12.01 && MealPrice <=17.00)
tax = 0.06 * MealPrice
tip = 0.16 * MealPrice
total = tax + MealPrice + tip
else if (MealPrice >=17.01 && MealPrice <=25.00)
tax = 0.06 * MealPrice
tip = 0.19 * MealPrice
total = tax + MealPrice + tip
else
tax = 0.06 * MealPrice
tip = 0.22 * MealPrice
total = tax + MealPrice + tip
Print tax , tip, total
End
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.