I need some help with this Python Program. I'm having trouble
with getting a output 1 of the 5 required. Tried twice and it wont
pop up.
Output#1 Nguyen, John
Bonus is $0
Hope this answer helps you. Please comment if you don't understand any. Also, please upload clearer screenshots. This one was very hard to understand. You can upload 2 smaller and clearer ones :)
I don't smell anything wrong except the fact that you are not printing the values
lastName = str(input("Enter last name: ")) firstName = str(input("Enter first name: ")) thisYearUnits = int(input("Enter this year's units: ")) lastYearUnits = int(input("Enter last year's units: ")) BONUS1 = 200 BONUS2 = 100 BONUS3 = 50 BONUS4 = 25 BONUS5 = 0 THISYEARSUNIT1 = 6001 THISYEARSUNIT2 = 3001 THISYEARSUNIT3 = 1001 THISYEARSUNIT4 = 1000 if thisYearUnits<lastYearUnits: bonus = BONUS5 print('{}, {}'.format(lastName, firstName)) print('Bonus is ${}'.format(BONUS5)) elif thisYearUnits>=THISYEARSUNIT1: bonus = BONUS1 print('{}, {}'.format(lastName, firstName)) print('Bonus is ${}'.format(BONUS1)) elif thisYearUnits>=THISYEARSUNIT2: bonus = BONUS2 print('{}, {}'.format(lastName, firstName)) print('Bonus is ${}'.format(BONUS2)) elif thisYearUnits>=THISYEARSUNIT3: bonus = BONUS3 print('{}, {}'.format(lastName, firstName)) print('Bonus is ${}'.format(BONUS3)) elif thisYearUnits<=THISYEARSUNIT4: bonus = BONUS4 print('{}, {}'.format(lastName, firstName)) print('Bonus is ${}'.format(BONUS4))
Sample output:
Enter last name: John
Enter first name: Nguyen
Enter this year's units: 300
Enter last year's units: 400
John, Nguyen
Bonus is $0
I need some help with this Python Program. I'm having trouble with getting a output 1...