Advertisement
Guest User

Untitled

a guest
Jun 30th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. meal = raw_input("Cost of meal: ")
  2. tax = raw_input("Tax: ")
  3. tip = raw_input("Tip: ")
  4.  
  5. def convertInput(meal, tax, tip):
  6.     retMeal = float(meal)
  7.     retTax = float(tax)
  8.     retTip = float(tip)
  9.     return retMeal, retTax, retTip
  10.  
  11. def tipCalc(meal, tax, tip):
  12.    
  13.     retMeal, retTax, retTip = convertInput(meal, tax, tip)
  14.    
  15.     retTax = retTax / 100
  16.     retTax = retTax * retMeal
  17.     retMeal = retTax + retMeal
  18.     retTip = retTip / 100
  19.     retTip = retTip * retMeal
  20.     total = retMeal + retTip
  21.     print total
  22.  
  23. tipCalc(meal, tax, tip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement