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. 523). 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: 123456 Enter department: Accounting Enter position: Accountant Enter employee name: Joe Morales Enter employee ID: 678910 Enter department: Engineering Enter position: Engineer Enter employee name: Marie Zinc Enter employee ID: 45678 Enter department: Customer Service Enter position: Customer Service Rep Employee 1 : Name: Mary Smith ID number: 123456 Department: Accounting Title: Accountant Employee 2 : Name: Joe Morales ID number: 678910 Department: Engineering Title: Engineer Employee 3 : Name: Marie Zinc ID number: 45678 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 print(object_name). Turn in two files, employee.py and your main program (yourlastname_Lab10.py), along with the regular documentation requirements required by the syllabus and as listed in Lab 2

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 1CP: In previous chapters, you have created programs for the Greenville Idol competition. Now create a...
icon
Related questions
Question

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. 523).

 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:  123456

Enter department: Accounting

Enter position: Accountant

 

Enter employee name: Joe Morales

Enter employee ID:  678910

Enter department: Engineering

Enter position: Engineer

 

Enter employee name: Marie Zinc

Enter employee ID:  45678

Enter department: Customer Service

Enter position: Customer Service Rep

 

Employee  1 :

Name: Mary Smith

ID number: 123456

Department: Accounting

Title: Accountant

 

Employee  2 :

Name: Joe Morales

ID number: 678910

Department: Engineering

Title: Engineer

 

Employee  3 :

Name: Marie Zinc

ID number: 45678

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  print(object_name).

Turn in two files, employee.py and your main program (yourlastname_Lab10.py), along with the regular documentation requirements required by the syllabus and as listed in Lab 2.  Do not forget to include the UML and Hierarchy diagrams.

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT