Ask Question
12 January, 12:41

Write a program that calculates the total amount of a meal purchased at a restaurant by a customer. The program should ask the user to input the charges of the food, then calculate the amounts of a 18% tip and 7 % sales tax. Display each of these amounts and total charges.

+5
Answers (1)
  1. 12 January, 13:02
    0
    Python script is given below

    Explanation:

    charge = float (input ('Enter the amount you were charged. $'))

    #setting the formula for tip and tax

    tip = charge*.18

    tax = charge*.07

    #printing the values

    print ('Charge for the food: %.2f' % charge)

    print ('The tip amount: %.2f' % tip)

    print ('Tax amount: %.2f' % tax)

    print ('Total amount: %.2f' % (charge+tip+tax))
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a program that calculates the total amount of a meal purchased at a restaurant by a customer. The program should ask the user to ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers