Answer
The program reads the following information and prints a payroll statement.
Work Step by Step
The program reads the following information and prints a payroll statement.
$Code:$
$empName$=input("Enter Employee's name:")
$hoursWorked$=float(input("Enter number of hours worked:"))
$hourlyRate$=float(input("Enter hourly pay rate:"))
$fedTaxWithHoldingRate$=float(input("Enter federal tax withholding rate:"))
$stateTaxWithHoldingRate$=float(input("Enter state tax with holding rate:"))
$grossPay$=hourlyRate*hoursWorked
$fedWithHolding$=grossPay*fedTaxWithHoldingRate
$stateWithJolding$=grossPay*stateTaxWithHoldingRate
$totalDeduction$=fedWithHolding+stateWithJolding
$netPay$=grossPay-totalDeduction
print("Employee name:"+empName)
print("Hours Worked:"+hoursWorked)
print("Hourly Rate:"+hourlyRate)
print("Gross pay:"+grossPay)
print("Deduction: ")
print("\tfederal WIthHolding
("+fedTaxWithHoldingRate*100+"):"+fedWithHolding)
print("\tState
WithHolding("+stateTaxWithHoldingRate*100+"):"+stateWithJolding)
print("\tTotal Deduction:"+totalDeduction)
print("Net Pay:"+netPay)