Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Debug this Python Exercise for me . I am having allot of issues with it. # Program that calculates the total amount of a

Please Debug this Python Exercise for me . I am having allot of issues with it.

# 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, then calculate the amount

# of a 18 percent tip and 7 percent sales tax.Display each of

# these amounts and the total formatted with two decimal places.

TAX_RATE = 0.07

TIP_RATE = 0.18

food = float(input("Enter the charge for food: ")

tip = food * TIP_RATE

tax = food * TAX_RATE

total = food + tip + tax

print ("Tip: $", format(tip, '2f'))

print ("Tax: $", format(tax, '2f'))

print ("Total: $", format(total, '2f'))

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

Step: 3

blur-text-image

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

1. Why did Margry's strategy succeed?

Answered: 1 week ago