1 Star 0 Fork 0

drainkeng/python_commissions

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
calc.py 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
Mark Milligan 提交于 2021-05-31 18:02 . initial commissions app
def plantype(args):
# commission plan
# fixedrate or varrate or leveraged
pt = args[0]
# revenue 115000
r = args[1]
# variable compensation 100000
v = args[2]
# quota 500000
q = args[3]
# quota attained so far 0
a = args[4]
if pt == "fixedrate":
rt = float(input(f"entered commission rate: "))
print("what you typed: " + str(rt))
commission,rt = fixedrate(r,rt)
if pt == "varrate":
commission,rt = varrate(q, v, r)
if pt == "leveraged":
commission,rt = leveraged(q, v, r)
inputs(pt,r,v,q,a)
print('\n** Commission Calculations **')
print("commission: $" + str(commission))
print('rate (or attainment): ' + str(rt*100) + "%")
def inputs(pt,r,v,q,a):
print('\n** Input & References Variables **')
print('plan type: ' + pt)
print('revenue: $' + r)
print('variable compensation: $' + v)
print('quota: $' + q)
print('quota attained before this revenue: $' + a)
def fixedrate(r,rt):
rt = float(rt)/100
r = float(r)
return r*rt, rt
def varrate(q,v,r):
q = float(q)
v = float(v)
r = float(r)
rate = v / q
return rate * r, rate
def leveraged(q,v,r):
q = float(q)
v = float(v)
r = float(r)
attain = r / q
return v*attain, attain
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/drainkeng/python_commissions.git
git@gitee.com:drainkeng/python_commissions.git
drainkeng
python_commissions
python_commissions
master

搜索帮助