Ask Question
28 December, 23:32

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.

+1
Answers (1)
  1. 28 December, 23:40
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers