Question: For the class Employee example provided in tutorial 3.1.5, what code segment could be added to keep track of the number of job titles ever

For the class Employee example provided in tutorial 3.1.5, what code segment could be added to keep track of the number of job titles ever held by an employee? def __init__(fname, lname, empid, title, sal): num_job_titles = 1 def set_jobtitle(title): if len(title) > 0: jobtitle = title num_job_titles += 1 def get_num_jobtitles(): return num_job_titles def __init__(fname, lname, empid, title, sal): self.num_job_titles = 1 def set_jobtitle(title): if len(title) > 0: self.jobtitle = title self.num_job_titles += 1 def get_num_jobtitles(): return self.num_job_titles def __init__(self, fname, lname, empid, title, sal): self.num_job_titles = 1 def set_jobtitle(self,title): if len(title) > 0: self.jobtitle = title self.num_job_titles += 1 def get_num_jobtitles(self): return self.num_job_titles def __init__(self, fname, lname, empid, title, sal): num_job_titles = 1 def set_jobtitle(self,title): if len(title) > 0: jobtitle = title num_job_titles += 1 def get_num_jobtitles(self): return num_job_titles

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!