Question: Lab 1 0 Classes Personal Information Class: Design a class called Employee that holds the following data about an employee: name ID number Department Job
Lab Classes
Personal Information Class:
Design a class called Employee that holds the following data about an employee:
name
ID number
Department
Job Title
Class. Store your class in a separate file called employee.py
Your class will have an initializer method that will be passed the information entered by the user as arguments.
Write appropriate accessor and mutator methods for each data attribute.
Write a str method to print the contents of the class see example of str on p
Main program:
Your main program should create three instances of the class. Your program should get the information from the user and pass it as parameters to the initializer method. Using the str method invoked by the print function, the program should display the personal information for the three individuals.
Output and Sample Dialog:
Enter employee name: Mary Smith
Enter employee ID:
Enter department: Accounting
Enter position: Accountant
Enter employee name: Joe Morales
Enter employee ID:
Enter department: Engineering
Enter position: Engineer
Enter employee name: Marie Zinc
Enter employee ID:
Enter department: Customer Service
Enter position: Customer Service Rep
Employee :
Name: Mary Smith
ID number:
Department: Accounting
Title: Accountant
Employee :
Name: Joe Morales
ID number:
Department: Engineering
Title: Engineer
Employee :
Name: Marie Zinc
ID number:
Department: Customer Service
Title: Customer Service Rep
Note: You may not actually be using the setter and getter methods but to be complete, your class needs to include them.
See Cellphone class example. Instead of using this method of printing, invoke str in main by using printobjectname
Turn in two files, employee.py and your main program yourlastnameLabpy
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
