Answered step by step
Verified Expert Solution
Link Copied!

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

UNIV199 Introduction to Programing with Python
Homework #7
Due: Jan 10,2024, Wednesday, 23:59. 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 (employee_names, fired_employee_names, employee_official_titles, and employee_current_salary) are initialized.
The company maintains employee data in a list. Every information in the lists has an index that corresponds to the employee_names list (e.g. 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"]
fired_names =["Jim Halpert","Oscar Martinez"]
titles =["Regional manager","Accountant","Regional Manager","Receptionist", "Regional
Manager","Receptionist"]
salary =[100000,80000,110000,50000,120000,40000]
The program must also have the following functions:
Function 1: fire_employees 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 3 lists. They are new names, titles and salaries lists after the fired employees are deleted.
Function 2: calc_updated_salaries 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 $20,000 increase while other employees get a $10,000 increase. It returns the list of updated salaries.
The salary update rule: For managing level titles is $20,000. $10,000 for other job titles.
Function 3: information_report 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 information_report function after each operation, the final results should appear as
follows.
Save your program as hw07yoursurname.py. Upload your file to Blackboard at Homework 7. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

Explain the nature of human resource management.

Answered: 1 week ago