(Financial application: payroll) Write a program that reads the following infor-
ID: 3586064 • Letter: #
Question
(Financial application: payroll) Write a program that reads the following infor- mation and prints a payroll statement: Employee's name (e.g., Smith) Number of hours worked in a week (e.g., 10) Hourly pay rate (e.g., 9.75) Federal tax withholding rate (eg, 20%) State tax withholding rate (e.g., 9%) A sample run is shown below: Enter employee's name: Smithter Enter number of hours worked in a week: 10 Enter Enter hourly pay rate: 9.75 Fenter Enter federal tax withholding rate : 0.20 I-Enter Enter state tax withholding rate: 0.09 -Enter Employee Name: SmithExplanation / Answer
Hi,
Below is the python code for the requirement-
Python code-
name=input("enter employee's name")
hours=input("enter number of hours worked ina week")
payrate=("enter the hourly pay rate")
fedtax=input("enter federal tax rate")
statetax=input("enter state tax rate")
print("employee name: ",name)
print("payrate:$",payrate)
print("gross pay:$",hours*payrate)
print("federal withholding(",fedtax*100,"):$",hours*payrate*fedtax)
print("state withholding(",statetax*100,"):$",hours*payrate*statetax)
deduction=(hours*payrate*statetax)+(hours*payrate*fedtax)
print("total deductions:$", deduction)
print("net pay:$",hours*payrate-deduction)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.