Question: Is there anything wrong with my code? i keep getting the 'could not convert string to float' value error. Write a program that computes the

Is there anything wrong with my code? i keep getting the 'could not convert string to float' value error.

Write a program that computes the tax and the tip on a restaurant bill. The program should ask the user to enter the charge of the meal. The tax should be 6.75 percentage of the meal charge. The tip should be 20 percent of the total after adding the tax. Display the meal charge, tax amount, tip amount, and the total bill on the screen. Please make sure you add the appropriate comments through out the program. Please submit your .py file.

meal_charge = float(input("Enter the charge for the meal: ")) tax_amount = meal_charge * 0.0675 total_with_tax = meal_charge + tax_amount

print("Meal charge: $%.2f" % meal_charge) print("Tax amount: $%.2f" % tax_amount) print("Total with tax: $%.2f" % total_with_tax)

tip_amount = total_with_tax * 0.20 total_with_tip = total_with_tax + tip_amount

print("Tip amount: $%.2f" % tip_amount) print("Total to be paid with tip: $%.2f" % total_with_tip)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!