Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python Program. PROBLEM DEFINITION: Write a class named Employee that holds the

ID: 3817584 • Letter: P

Question

Python Program.

PROBLEM DEFINITION: Write a class named Employee that holds the following data about an employee in attributes:

name

IDnumber

department

jobTitle

The class should have 8 methods as follows:

For each attribute, there should be a method that takes a parameter to be assigned to the attribute

For each attribute, there should be a method that returns the attribute Once you have written the class, write a main function that creates three Employee objects. Your main function should then do the following for each of the three objects:

Once you have written the class, write a main function that creates three Employee objects. Your main function should then do the following for each of the three objects:

a. Display a message asking user to enter employee name, ID, department, and title

b. Read employee name into a variable

c. Call the set name method of the first object passing the name

d. Read employee ID into a variable

e. Call the set IDnumber method of the first object passing ID

f. Read employee department into a variable

g. Call the set department method of the first object passing the department

h. Read employee title into a variable

i. Call the set job title method of the first object passing the title

After reading and storing the employee information, the main function should call a function called displayEmployees passing the three objects as arguments. The displayEmployees function should call the methods of the objects that return attributes and display the returned values. The output should be formatted as follows: and only use Input, Processing, and Output, Functions, and Classes and Object-Oriented Programming.

I need this program to be done using Python language.

Explanation / Answer

# starting of Employee class
class Employee(object):
  
def __init__(self): #declaring Constructor
self.name = ""
self.iDnumber = ""
self.department = ""
self.jobTitle = ""
  
# setter methode for setting values to the class properties
def setName(self,name):
self.name=name
def setIDnumber(self,iDnumber):
self.iDnumber=iDnumber
def setDepartment(self,department):
self.department=department
def setJobTitle(self,jobTitle):
self.jobTitle=jobTitle
  
# getter methode for getting values of the class properties
def getName(self):
return self.name
def getIDnumber(self):
return self.iDnumber
def getDepartment(self):
return self.department
def getJobTitle(self):
return self.jobTitle

# methode which takes object as an argument and display its properties
def display(emp_object):
print("Name : ",emp_object.getName())
print("IDnumber : ",emp_object.getIDnumber())
print("Department : ",emp_object.getDepartment())
print("JobTitle : ",emp_object.getJobTitle())

# Main methode of the program
if __name__ == "__main__":
employeeList = [] #List to hold the Employee objects
emp1 = Employee()
emp2 = Employee()
emp3 = Employee()
  
# appending objects to the list
employeeList.append(emp1)
employeeList.append(emp2)
employeeList.append(emp3)
  
# Initializing each objects of the list
for employee in employeeList:
emp_name = input("Enter your Name ")
employee.setName(emp_name)
emp_iDnumber = input("Enter your iDnumber ")
employee.setIDnumber(emp_iDnumber)
emp_department = input("Enter your Department ")
employee.setDepartment(emp_department)
emp_jobTitle = input("Enter your JobTitle ")
employee.setJobTitle(emp_jobTitle)
  
# Displaying each objects of the list
for emp_object in employeeList:
display(emp_object)