Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 3 - Mathematical Functions, Strings, and Objects - Programming Exercises - Page 87: 3.9

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)
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.