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.

Respuesta :

))

#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))