Question
Understanding Nested if Statements (brushing up on earlier assignments I didn't do too well on) Summary: In this lab, you complete a prewritten Python program
Understanding Nested if Statements (brushing up on earlier assignments I didn't do too well on)
Summary:
In this lab, you complete a prewritten Python program that calculates an employees productivity bonus and prints the employees name and bonus.
Bonuses are calculated based on an employees productivity score as shown in the table below. A productivity score is calculated by first dividing an employees transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Productivity Score | Bonus |
---|---|
<=30 | $50.00 |
31 - 69 | $75.00 |
70 - 199 | $100.00 |
>=200 | $200.00 |
Instructions:
1. Make sure the file EmployeeBonus.py is selected and open.
2. Variables have been declared for you, and the inputstatements and printstatements have been written. Read them over carefully before you proceed to the next step.
3. Design the logic and write the rest of the program using a nested if statement.
4. Execute the program by clicking the "Run Code" button at the bottom of the screen.
5. Enter the following as input:
Employees name: Kim Smith Number of Shifts: 25 Number of transactions: 75 Transaction dollar value: 40000.00
6. Your output should be:
Employee Name: Kim Smith Employee Bonus: $50.0
Assignment (EmployeeBonus.py):
BONUS_1 = 0.25 BONUS_2 = 0.15 BONUS_3 = 0.1 NO_BONUS = 0
RATING_1 = 1 RATING_2 = 2 RATING_3 = 3
employeeFirstName = input("Kim") employeeLastName = input("Smith") employeeSalary = float(input("40000")) employeeRating = int(input(""))
bonus = ("40000/75)*25") if productivityScore <=30: bonus = BONUS_1
print("Employee Name: " + employeeFirstName + " " + employeeLastName) print("Employee Bonus: $" + str(bonus))
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started