程序如下:
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
编写一个程序,读取雇员信息,然后打印一个工资表。
最新推荐文章于 2024-04-30 14:26:47 发布
该博客展示了一个Python程序,用于输入雇员的姓名、工作小时数、小时工资率以及联邦和州税扣税率,计算并打印出雇员的工资表,包括净工资、总扣税等详细信息。
摘要由CSDN通过智能技术生成