Answered step by step
Verified Expert Solution
Question
1 Approved Answer
UNIV 1 9 9 Introduction to Programing with Python Homework # 7 Due: Jan 1 0 , 2 0 2 4 , Wednesday, 2 3
UNIV Introduction to Programing with Python
Homework #
Due: Jan Wednesday, : Lists: Company Report
New Year New Rules in Dunder Mifflin!
New year brings joy and pain to the companies. Some employees get fired while others get salary increases. Dunder Mifflin is also passing through the same process. Salary adjustments will be made for the remaining staff after certain employees are fired. They want a report showing the final situation of the company.
You are given a starter file with functions and some variables employeenames, firedemployeenames, employeeofficialtitles, and employeecurrentsalary are initialized.
The company maintains employee data in a list. Every information in the lists has an index that corresponds to the employeenames list eg Dwight's information appears in every list's initial element. Kevin's are the second ones The names of the functions' arguments, return values or functions themselves should not be changed. Use only the functions that are provided in the starter code. Do not change the input lists. Your functions should carry out the tasks. If not, there will be no points given. It matters which functions are called and in what order. Take caution when doing that. You can delete pass statement after filling in the function.
names Dwight Schrute","Jim Halpert","Kevin Malone","Michael Scott"Pam Beesly","Oscar
Martinez"
firednames Jim Halpert","Oscar Martinez"
titles Regional manager","Accountant","Regional Manager","Receptionist", "Regional
Manager","Receptionist"
salary
The program must also have the following functions:
Function : fireemployees This function takes four lists as parameters. They are names, titles, and salaries information of the current employees as well as the list of fired employee names. It finds the fired employee information in the names, titles and salaries lists and deletes them from each of the corresponding lists. It returns the lists. They are new names, titles and salaries lists after the fired employees are deleted.
Function : calcupdatedsalaries This function takes two lists as parameters. They are titles and salaries information of the employees. It updates the salary of the employees according to their titles. Managers get a $ increase while other employees get a $ increase. It returns the list of updated salaries.
The salary update rule: For managing level titles is $ $ for other job titles.
Function : informationreport This function takes three lists as parameters. They are names, titles, and salaries information of the employees. It prints each employees name, title and the salary information in a single line. It does not return any value. No return in the function
Calling the informationreport function after each operation, the final results should appear as
follows.
Save your program as hwyoursurname.py Upload your file to Blackboard at Homework Make sure you place comments in your program. Place your name, ID as comments at the top. You should only use the features and commands you have learnt until this homework was g
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