Code:
Code as text:
# cost of order of each seats (in $)
seat1 = 13.50
seat2 = 12.00
seat3 = 14.64
seat4 = 22.70
seat5 = 16.73
appetizer = 9.99 #cost of appetizer
tax = 0.05 #sales tax is 5% = 0.05
order_total = seat1 + seat2 + seat3 + seat4 + seat5
total_bill = order_total + (tax * order_total)
print("Total bill: $%.2f" % (total_bill))
#correcting bill
shared_bill = appetizer / 3 #appetizer is shared by 1, 2, 3
# calculating bill
bill1 = (seat1 + shared_bill) * (1 + tax)
bill2 = (seat2 + shared_bill) * (1 + tax)
bill3 = (seat3 + shared_bill) * (1 + tax)
bill4 = seat4 * (1 + tax)
bill5 = seat5 * (1 + tax)
print("Splitted bill is: ")
print("Seat 1: $%.2f" % (bill1))
print("Seat 2: $%.2f" % (bill2))
print("Seat 3: $%.2f" % (bill3))
print("Seat 4: $%.2f" % (bill4))
print("Seat 5: $%.2f" % (bill5))
Sample run:
P.s. ask any doubts in comments and don't forget to rate the answer
Capture the following scenario using python. In a restaurant, there is a table with five people...
How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...