程序如下:
name = input(“Please input employee’s name:”)
hours = eval(input(“Please input number of hours worked in a week:”))
PayRate = eval(input(“Please input hourly pay rate:”))
federalRate = eval(input(“Please input federal tax withholding rate:”))
stateRate = eval(input(“Please input state tax withholding rate:”))
Federal = hours * PayRate * federalRate
State = hours * PayRate * stateRate
Gross = hours * PayRate
NetPay = hours * PayRate - Federal - State
Total = Federal + State
print(“Employee Name:”,name)
print(“Hours Worked:”,hours)
print(“Pay Rate: " , P a y R a