Q:

Write python 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, and then calculate the amount of a 18 percent tip. Then draw a flowchart for it

0

Write a 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, and then calculate the amount of a 18 percent

tip.

Then draw a flowchart for it.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

print("hello")
total_price=0
running=True
while running==True:
    total_price=total_price+int(input("pls enter the price of the meal"))
    choice=input("Do you want to enter another meal (Enter y for yes): ")
    if choice=="y":
        running=True
    elif choice=="n":
        running=False
    else:
        print("error, we will end the program")
        break
print("The total amount after the tip is:",total_price)

 

flowchart:

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now