Question

× |ls Python 3,7 3 Shell S classwork/Lab 8 py 【3.73) Python 3.7.3 (T3.7. 3: efte。6ed12, Baz 25 2019. 211261 53) [ASC v.1916 3

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

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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

Add a comment
Know the answer?
Add Answer to:
I need some help with this Python Program. I'm having trouble with getting a output 1...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT