题目:企业发放的奖金根据利润提成。利润 (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 ,求应发放奖金总数?
-*- coding: utf-8 -*-
#求企业发放的奖金根据利润提成
profit=input("请输入当月的利润:")
profit=int(profit)
if profit <= 100000:
bonus = profit*0.1 print("奖金为%s"%bonus) elif profit <= 200000 : bonus =(100000*0.1+(profit-100000)*0.075) print("奖金为%s"%bonus) elif profit <= 400000 : bonus = (100000 * 0.1 + 100000 * 0.075+(profit-200000)*0.05) print("奖金为%s"%bonus) elif profit <= 600000 : bonus = (100000 * 0.1 + 100000 * 0.075+200000*0.05+(profit-400000)*0.03)
print("奖金为%s"%bonus)
elif profit <= 1000000 :
bonus = (100000 * 0.1 + 100000 * 0.075+200000*0.05+200000*0.03+(profit-600000)*0.015) print("奖金为%s"%bonus) elif profit > 1000000: bonus = (100000 * 0.1 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + 400000 * 0.015+(profit-1000000)*0.001)
print("奖金为%s" % bonus)