Write a class named Employee that has private data members for an employee's name, ID_number, salary, and email_address. It should have an init method that takes four values and uses them to initialize the data members. It should have get methods named get_name, get_ID_number, get_salary, and get_email_address. Write a separate function (not part of the Employee class) named make_employee_dict that takes as parameters a list of names, a list of ID numbers, a list of salaries and a list of email addresses (which are all the same length). The function should take the first value of each list and use them to create an Employee object. It should do the same with the second value of each list, etc. to the end of the lists. As it creates these objects, it should add them to a dictionary, where the key is the ID number and the value for that key is the whole Employee object. The function should return the resulting dictionary. For example, it could be used like this: emp_names = ["Jean", "Kat", "Pomona"] emp_ids = ["100", "101", "102"] emp_sals = [30, 35, 28] emp_emails = ["Jean@aol.com", "Kat@aol.com", "Pomona@aol.com"] result = make_employee_dict (emp_names, emp_ids, emp_sals, emp_emails) print (result["100"].get_name()) Remember in your testing that printing an object of a user-defined class will just print out the object's type and address in memory. If you want to print the values of its data members, you need to call its get functions, as shown in the print statement above. The file must be named: make_employee_dict.py

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
project-8c
Write a class named Employee that has private data members for an employee's name, ID_number, salary, and
email_address. It should have an init method that takes four values and uses them to initialize the data members. It
should have get methods named get_name, get_ID_number, get_salary, and get_email_address.
Write a separate function (not part of the Employee class) named make_employee_dict that takes as parameters
a list of names, a list of ID numbers, a list of salaries and a list of email addresses (which are all the same length).
The function should take the first value of each list and use them to create an Employee object. It should do the
same with the second value of each list, etc. to the end of the lists. As it creates these objects, it should add them
to a dictionary, where the key is the ID number and the value for that key is the whole Employee object. The
function should return the resulting dictionary.
For example, it could be used like this:
emp_names = ["Jean", "Kat", "Pomona"]
emp_ids = ["100", "101", "102"]
emp_sals = [30, 35, 28]
emp_emails = ["Jean@aol.com", "Kat@aol.com", "Pomona@aol.com"]
result = make_employee_dict (emp_names, emp_ids, emp_sals, emp_emails)
print (result["100"].get_name())
Remember in your testing that printing an object of a user-defined class will just print out the object's type and
address in memory. If you want to print the values of its data members, you need to call its get functions, as shown
in the print statement above.
The file must be named: make_employee_dict.py
Transcribed Image Text:project-8c Write a class named Employee that has private data members for an employee's name, ID_number, salary, and email_address. It should have an init method that takes four values and uses them to initialize the data members. It should have get methods named get_name, get_ID_number, get_salary, and get_email_address. Write a separate function (not part of the Employee class) named make_employee_dict that takes as parameters a list of names, a list of ID numbers, a list of salaries and a list of email addresses (which are all the same length). The function should take the first value of each list and use them to create an Employee object. It should do the same with the second value of each list, etc. to the end of the lists. As it creates these objects, it should add them to a dictionary, where the key is the ID number and the value for that key is the whole Employee object. The function should return the resulting dictionary. For example, it could be used like this: emp_names = ["Jean", "Kat", "Pomona"] emp_ids = ["100", "101", "102"] emp_sals = [30, 35, 28] emp_emails = ["Jean@aol.com", "Kat@aol.com", "Pomona@aol.com"] result = make_employee_dict (emp_names, emp_ids, emp_sals, emp_emails) print (result["100"].get_name()) Remember in your testing that printing an object of a user-defined class will just print out the object's type and address in memory. If you want to print the values of its data members, you need to call its get functions, as shown in the print statement above. The file must be named: make_employee_dict.py
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY