Question: Write a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge
Write a program that calculates the total amount of a meal purchased at a restaurant. The
program should ask the user to enter the charge for the food, and then calculate the amount
of a 15 percent tip and 7 percent sales tax. Display each of these amounts and the total.
I have this down but need help with running it... Once I run it, its asking me for the amount and I don't know what to put or how to do it? any help?
#Get the total amount of meal purchase
totalMealPurchased = float(input(Enter the charge for the food : ))
#calculate the tip(15%)
tip = totalMealPurchased * .15
#calculate the sales tax(7%)
saleTax = totalMealPurchased * .07
#calculate the total sales
totalPurchased =( totalMealPurchased + tip + saleTax )
#display the total amount of meal purchase
print(Amount of the meal purchase :,format(totalMealPurchased , ,.2f))
#display the tip
print(Amount of the tip :,format(tip , ,.2f))
#display the sales tax
print(Amount of the sales tax :,format(saleTax , ,.2f))
#display the total purchased
print(total purchased :,format(totalPurchased , ,.2f))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
