# 题目:企业发放的奖金根据利润提成。
# 利润(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,求应发放奖金总数?
# 1.输入当月利润
# 数据的有效性验证
income = input("请输入当月利润(单位:万元):")
income = float(income)
# 2.分析属于哪个区间
# 2.1.计算奖金
if income <= 10:
bonus = income * 0.1
span = "一"
elif 10 < income <= 20:
bonus = 10 * 0.1 + (income - 10) * 0.075
span = "二"
elif 20 < income <= 40:
bonus = 10 * 0.1 + 10 * 0.075 + (income - 20) * 0.05
span = "三"
elif 40 < income <= 60:
bonus = 10 * 0.1 + 10 * 0.075 + 20 * 0.05 + (income - 40) * 0.03
span = "四"
elif 60 < income <= 100:
bonus = 10 * 0.1 + 10 * 0.075 + 20 * 0.05 + 20 * 0.03 + (income - 60) * 0.015
span = "五"
else:
bonus = 10 * 0.1 + 10 * 0.075 + 20 * 0.05 + 20 * 0.03 + (100 - 60) * 0.015 + (income - 100) * 0.01
span = "六"
# 3.输出奖金
print("当月利润为:{:.4f},属于第{}区间范围,应发奖金总数为:{:.4f}".format(income, span, bonus))
# i = int(input('Enter the profit:'))
# arr = [1000000, 600000, 400000, 200000, 100000, 0]
# rat = [0.01, 0.015, 0.03, 0.05, 0.075, 0.1]
# r = 0
# for idx in range(0, 6):
# if i > arr[idx]:
# r += (i - arr[idx]) * rat[idx]
# print((i - arr[idx]) * rat[idx])
# i = arr[idx]
# print(r)
没有合适的资源?快使用搜索试试~ 我知道了~
Python 100例代码
共146个文件
dll:53个
py:48个
pyd:25个
需积分: 49 40 下载量 39 浏览量
2018-09-18
21:28:26
上传
评论 2
收藏 7.16MB RAR 举报
温馨提示
Python 100例的代码,基于3.x版本手动敲打,请好评哦。目前只有前面一半,后面会陆续更新,欢迎收藏
资源推荐
资源详情
资源评论
收起资源包目录
Python 100例代码 (146个子文件)
activate 2KB
activate.bat 1KB
deactivate.bat 368B
python36.dll 3.44MB
tk86t.dll 1.88MB
tcl86t.dll 1.59MB
sqlite3.dll 1.1MB
ucrtbase.dll 978KB
msvcp140.dll 625KB
vccorlib140.dll 385KB
xlwings64-0.11.8.dll 359KB
concrt140.dll 327KB
xlwings32-0.11.8.dll 287KB
vcomp140.dll 181KB
vcruntime140.dll 87KB
api-ms-win-crt-private-l1-1-0.dll 70KB
python3.dll 50KB
api-ms-win-crt-math-l1-1-0.dll 26KB
api-ms-win-crt-multibyte-l1-1-0.dll 26KB
api-ms-win-crt-string-l1-1-0.dll 24KB
api-ms-win-crt-stdio-l1-1-0.dll 24KB
api-ms-win-crt-convert-l1-1-0.dll 22KB
api-ms-win-crt-runtime-l1-1-0.dll 22KB
api-ms-win-core-file-l1-1-0.dll 22KB
api-ms-win-crt-time-l1-1-0.dll 21KB
api-ms-win-core-localization-l1-2-0.dll 21KB
api-ms-win-core-synch-l1-1-0.dll 20KB
api-ms-win-core-processthreads-l1-1-0.dll 20KB
api-ms-win-crt-filesystem-l1-1-0.dll 20KB
api-ms-win-crt-process-l1-1-0.dll 19KB
api-ms-win-core-processenvironment-l1-1-0.dll 19KB
api-ms-win-crt-conio-l1-1-0.dll 19KB
api-ms-win-crt-heap-l1-1-0.dll 19KB
api-ms-win-core-sysinfo-l1-1-0.dll 19KB
api-ms-win-core-libraryloader-l1-1-0.dll 19KB
api-ms-win-core-console-l1-1-0.dll 19KB
api-ms-win-core-heap-l1-1-0.dll 19KB
api-ms-win-crt-environment-l1-1-0.dll 19KB
api-ms-win-crt-utility-l1-1-0.dll 19KB
api-ms-win-core-memory-l1-1-0.dll 19KB
api-ms-win-crt-locale-l1-1-0.dll 19KB
api-ms-win-core-rtlsupport-l1-1-0.dll 19KB
api-ms-win-core-processthreads-l1-1-1.dll 19KB
api-ms-win-core-synch-l1-2-0.dll 19KB
api-ms-win-core-string-l1-1-0.dll 18KB
api-ms-win-core-interlocked-l1-1-0.dll 18KB
api-ms-win-core-timezone-l1-1-0.dll 18KB
api-ms-win-core-file-l2-1-0.dll 18KB
api-ms-win-core-debug-l1-1-0.dll 18KB
api-ms-win-core-datetime-l1-1-0.dll 18KB
api-ms-win-core-errorhandling-l1-1-0.dll 18KB
api-ms-win-core-namedpipe-l1-1-0.dll 18KB
api-ms-win-core-file-l1-2-0.dll 18KB
api-ms-win-core-handle-l1-1-0.dll 18KB
api-ms-win-core-profile-l1-1-0.dll 18KB
api-ms-win-core-util-l1-1-0.dll 17KB
setuptools-39.1.0-py3.6.egg 550KB
python.exe 92KB
pythonw.exe 90KB
easy_install-3.6.exe 73KB
pip3.6.exe 73KB
pip3.exe 73KB
pip.exe 73KB
easy_install.exe 73KB
03-LearningFiles.iml 518B
Activate.ps1 1KB
setuptools.pth 31B
practice-002.py 2KB
practice-004.py 1023B
practice-031.py 996B
基本序列和映射协议.py 992B
practice-023.py 901B
practice-024.py 860B
practice-014.py 822B
practice-001.py 740B
practice-020.py 716B
practice-006.py 635B
practice-016.py 559B
practice-039.py 556B
practice-003.py 540B
practice-022.py 534B
practice-017.py 526B
practice-030.py 492B
easy_install-3.6-script.py 490B
practice-037-排序.py 490B
easy_install-script.py 482B
practice-015.py 481B
practice-005.py 480B
practice-018.py 455B
pip3.6-script.py 449B
pip3-script.py 445B
pip-script.py 443B
practice-019.py 439B
practice-021.py 437B
practice-013.py 423B
practice-028.py 418B
practice-029.py 358B
practice-035.py 319B
practice-011.py 308B
practice-027.py 292B
共 146 条
- 1
- 2
资源评论
Nutcracker666
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功