【发布时间】:2018-08-02 13:20:26
【问题描述】:
一家公司决定给员工发奖金。男性员工可获得 5% 的奖金,女性员工可获得 10% 的奖金。如果员工的工资低于 10000 则员工获得 2% 的额外奖金。
计算工资和奖金。
我的代码如下所示:
a = input('Enter your name here: ')
b = int(input('your salary here: '))
c = input('your gender here (M/F) : ')
if b < 10000 and c == 'M':
print(str(a) + ' your salary with bonus is ' + str(b * 1.07))
elif b < 10000 and c == 'F':
print(str(a) + ' your salary with bonus is ' + str(b * 1.12))
if b >= 10000 and c == 'M':
print(str(a) + ' your salary with bonus is '+ str(b * 1.05))
elif b >= 10000 and c=='F':
print(str(a) + ' your salary with bonus is '+ str(b * 1.1))
【问题讨论】:
-
什么是错误?请提供一些示例输入,然后告诉我们您得到什么输出以及您期望什么输出。 This page 也可能有帮助。
标签: python python-3.x