Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USING IDLE PYTHON Create two a programs A-write a program that calculates the amount of a meal purchased at a resturant. the program should ask
USING IDLE PYTHON Create two a programs
A-write a program that calculates the amount of a meal purchased at a resturant. the program should ask for the User to enter the charge for the food, then calculate the amounts of a 18% tip and 7% sales tax. DISPLAY each of these AMOUNTS and TOTAL.
def total(charge): #total function to calculate the total bill which takes food charge as parameter tip=0.18*charge #tip calculation tax=.07*charge #tax calculation print("Charge for the food is: ",charge) #food charge printed print("Tips charges is: ",tip) #top charge printed print("Tax charges is: ",tax) #tac charge printed print("Total amount is: ",charge+tip+tax) #total amount printed charge=int(input("Enter the amount of food food ordered to calculate the total bill: ")) #input food charge from user total(charge) #call the total function.
then B-prompt the user for the type of service Good worth 18% tip, Bad worth 0%, or OK worth 15%. Based on the level of service, adjust the tip accordingly. Display the cost of the food (pre-tip and tax) the cost of the tax(pre-tip), the tip, the total
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started