In: Computer Science
Please use Phyton to write a program:
Write a program that calculates and displays the total bill at a restaurant for a couple that is dining. The program should collect from the couple, cost of each meal, and the percentage of the final cost that they would like to tip. The sales tax in the state where the restaurant exists is 7.5%.
Display to the user, line by line:
Explanation:
here is the code which takes the anount of both the meals and then calculate the total and adds the sales tax to it.
Also, it takes the tip percentage and calculates the tip.
Code:
first = float(input("Enter cost of first meal: "))
second = float(input("Enter cost of second meal: "))
tip_percent = float(input("what percent of total you want to spend
in tip? "))
total = first + second
print("Total cost of both meals: $"+str(total))
sales_tax = 0.075*total
total = total + sales_tax
print("Sales Tax: $"+str(sales_tax))
tip = (tip_percent*total)/100.0;
print("Tip: $"+str(tip))
total =total + tip
print("Total Bill: $"+str(total))
Output: