Guest User

Untitled

a guest
Jul 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3.  
  4. #Program uses modules to enter the total sales for the month. The pplication should calculate:
  5. #Amount of county sales tax, amount of states sales tax, and total sales tax (county plus state)
  6.  
  7. #welcome function
  8. def welcome_initial():
  9. print "\tWelcome to my Program using functions"
  10.  
  11.  
  12. #calculation function
  13. def calc_tax(STATE_TAX,COUNTY_TAX,Month,TOTAL_SALES): # forgot this oops :P
  14. totalTax = STATE_TAX + COUNTY_TAX
  15. stateTotal = TOTAL_SALES * STATE_TAX
  16. countyTotal = TOTAL_SALES * COUNTY_TAX
  17. totalPlus = TOTAL_SALES * totalTax
  18. return (totalTax,stateTotal,countyTotal,totalPlus)
  19.  
  20. # Set main vars
  21. STATE_TAX = 0.04 #State tax constant
  22. COUNTY_TAX = 0.02 #County tax constant
  23. Month = raw_input("Enter the month for this record\n")
  24. TOTAL_SALES = input("Enter the total Sales for this month\n")
  25.  
  26. #call initial welcome function
  27. welcome_initial()
  28.  
  29. #pass in main vars to calc function and return tax calculations
  30. totalTax, countyTotal, stateTotal, totalPlus = calc_tax(STATE_TAX,COUNTY_TAX,Month,TOTAL_SALES)
  31.  
  32.  
  33. # display results
  34. print "Taxes for ", Month, "\n"
  35. print "\tCounty Tax = $", countyTotal, "\tState Tax = $", stateTotal
  36. print "\tTotal Sales Tax = $", totalPlus
  37. raw_input("Press enter to exit")
Add Comment
Please, Sign In to add comment