149k views
5 votes
Write a python program that calculates the amount of meal purchased in a restaurant. The program shoud ask the user for the charge of the meal Then calculate the amount of a 18% tip and 7 % sales tax. Display the tip, tax and the Overall Total.

1 Answer

6 votes

Answer:

charge = float(input())

tip = charge*0.18

tax = charge*0.07

print('tip:',round(tip))

print('tax:',round(tax))

print('total:',round(charge+tip+tax))

Step-by-step explanation:

Step 1 read the user charge

charge = float(input())

Step 2 calculate the tip and taxes

tip = charge*0.18

tax = charge*0.07

step 3 show results

print('tip:',round(tip))

print('tax:',round(tax))

print('total:',round(charge+tip+tax))

User Kirby Todd
by
9.3k points

Related questions