- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex2.py
More file actions
Latest commit
20 lines (18 loc) · 847 Bytes
/
Copy pathex2.py
File metadata and controls
20 lines (18 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'''
企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,
奖金可提10%;利润高于10万元,低于20万元时,低于10万元
的部分按10%提成,高于10万元的部分,可提成7.5%;20万到
40万之间时,高于20万元的部分,可提成5%;40万到60万之间
时高于40万元的部分,可提成3%;60万到100万之间时,高于
60万元的部分,可提成1.5%,高于100万元时,超过100万元
的部分按1%提成,从键盘输入当月利润I,求应发放奖金总数
'''
reward=0
x=float(input("请输入您的利润(万元):"))
profit= [100, 60, 40, 20, 10,0]
rate= [0.01, 0.015, 0.03, 0.05, 0.075, 0.1]
foriinrange(6):
ifx>=profit[i]:
reward+= (x-profit[i]) *rate[i]
x=profit[i]
print("您的奖金为%.3f万元。"%reward)