Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #Program uses modules to enter the total sales for the month. The pplication should calculate:
- #Amount of county sales tax, amount of states sales tax, and total sales tax (county plus state)
- #welcome function
- def welcome_initial():
- print "\tWelcome to my Program using functions"
- #calculation function
- def calc_tax(STATE_TAX,COUNTY_TAX,Month,TOTAL_SALES): # forgot this oops :P
- totalTax = STATE_TAX + COUNTY_TAX
- stateTotal = TOTAL_SALES * STATE_TAX
- countyTotal = TOTAL_SALES * COUNTY_TAX
- totalPlus = TOTAL_SALES * totalTax
- return (totalTax,stateTotal,countyTotal,totalPlus)
- # Set main vars
- STATE_TAX = 0.04 #State tax constant
- COUNTY_TAX = 0.02 #County tax constant
- Month = raw_input("Enter the month for this record\n")
- TOTAL_SALES = input("Enter the total Sales for this month\n")
- #call initial welcome function
- welcome_initial()
- #pass in main vars to calc function and return tax calculations
- totalTax, countyTotal, stateTotal, totalPlus = calc_tax(STATE_TAX,COUNTY_TAX,Month,TOTAL_SALES)
- # display results
- print "Taxes for ", Month, "\n"
- print "\tCounty Tax = $", countyTotal, "\tState Tax = $", stateTotal
- print "\tTotal Sales Tax = $", totalPlus
- raw_input("Press enter to exit")
Add Comment
Please, Sign In to add comment