326,645 views
7 votes
7 votes
January 19/May 16 2022

Assignment 10 - Due May 15th
Do:
Write a Python program that will compute the potential raise for an employee based on the
department the employee works in. Valid departments are 'HR’, "EXEC', 'TRAIN'. Here are the
formulas for raises:
HR = 5% raise
EXEC = 10% raise
TRAIN = 15% raise (hey it can happen!)
So. If the employee belongs to the 'HR" department, and makes S50 on norun
th

January 19/May 16 2022 Assignment 10 - Due May 15th Do: Write a Python program that-example-1
User Patnz
by
3.0k points

1 Answer

14 votes
14 votes

Answer:

This should get you started. Many things could be improved. You could keep adding layers to this program if you wanted to, so I wrote it with that in mind.

The new salary depends on the employee's department and current salary. I created a class that represents each employee. The function looks at the employee's current salary, and looks up what the employee's department raise will be (using the dictionary/hash table) before performing the calculation.

January 19/May 16 2022 Assignment 10 - Due May 15th Do: Write a Python program that-example-1
User Varad
by
3.2k points