taxandtip.py

Tax and Tip

#!/usr/bin/env python3 



# Mina's tax and tip  

# 

# 1. input cost of meal 

# 3. compute the tip of 18 percent of the meal without tax 

# 4. output the tax amount 

# 5. output the tip amount 

# 6. output the grand total 

# 7. format the output so all the values are displayed using 2 decimals 



taxes_percent = 6.875 

taxes = taxes_percent/100.0 



tip_percent = 18 

tip = tip_percent/100.0 



cost_meal = input('What is the cost of your meal? ') 

cost_meal = float(cost_meal) 



total_tax = cost_meal * taxes 



print('Total Taxes: $%0.2f' % total_tax) 



total_tip = cost_meal * tip 



print('Total Tip : $%0.2f' % total_tip) 



grand_total = total_tip + total_tax + cost_meal 

links