python,使用if else语句计算曲棍球工资

时间:2018-11-07 00:53:05

标签: python python-3.x

关于我正在创建的程序: 这是我无法很好解决的工资计算作业问题。问题是要求用户提供五项输入。基本工资,进球,助理,球员得分,对阵球员得分。使用输入来计算目标+资产的收益。如果总分低于75分,则每分$ 5000。如果总分高于75分,则75分以上每得分10,000美元,其余为5000美元。使用输入来计算正负分数。从与玩家对抗的目标中减去玩家的目标。如果总计为正,则为$ 25000。然后显示总收入。

我在哪里 我的输入减少了,点数减少了,我觉得我的正负分数代码正确,但是它没有将其计算为最终结果。我也对如何将所有内容加在一起并进行总计打印感到困惑。


 salary = int(input('Enter base salary for player: '))
    goals = int(input('Enter goals scored by player: '))
    asst = int(input('Enter assists credited to the player: '))
    scored = int(input('Enter goals we scored when player was on the ice: '))
    against = int(input('Enter goals against player, when player was on the ice: '))

    scoring_point = 0 
    plus_minus = 0

    if scoring_point > 75: 
        scoring_point = goals + asst
        point_bonus_greater = (scoring_point - 75) * 10000
        point_2 = point_bonus_greater + 375000
        print ('total for points is: $', point_2)
    elif scoring_point < 75:
        scoring_point = goals + asst
        scoring_point2 = scoring_point * 5000
        print('total for points is: $', scoring_point2)
    elif plus_minus > 0:
        plus_minus2 = plus_minus * 25000
        print ('total plus/minus: $', plus_minus2)
    else:
        print('i suck')

0 个答案:

没有答案