Advance code for TIP calc

python

#1



meal=(input("Cost of the meal:"))
tax=.0675
tip=.15
tax_amount=meal*tax
overall_cost=((meal) + (meal * tax))
print "Service Tax charged @ 6.75%"
print "Cost of the meal including TAX  :", "%.2f" %overall_cost
print "TIP charged @ 15%"
tip_payable=overall_cost * tip
print "TIP :", "%.2f" %tip_payable
Payable_amount=overall_cost + tip_payable
print ('Amount to be paid includes cost of meal :{0}, Tax charged: {1} and TIP: {2} which equals:'.format("%.2f" %meal , "%.2f" %tax_amount, "%.2f" %tip_payable)), "%.2f" %Payable_amount


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.