# wagesfmt.py # Computes the taxes and wages for an employee given the # number of hours worked and their pay rate. The results # are printed using formatted strings. # Set tax rates as constants. STATE_TAX_RATE = 0.035 FED_TAX_RATE = 0.15 # Extract data from the user. employee = raw_input( "Employee name: " ) hours = float( raw_input( "Hours worked: " ) ) payRate = float( raw_input( "Pay rate: " ) ) # Compute the employee's taxes and wages. wages = hours * payRate stateTaxes = wages * STATE_TAX_RATE fedTaxes = wages * FED_TAX_RATE takeHome = wages - stateTaxes - fedTaxes # Print the results. print "PAY REPORT" print "Employee: %s" % employee print "----------------------------------" print "Wages: %8.2f" % wages print "State Taxes: %8.2f" % stateTaxes print "Fed Taxes: %8.2f" % fedTaxes print "Pay: %8.2f" % takeHome