Question: For the class Employee example provided in tutorial 3 . 1 . 5 , if for auditing purposes we needed to keep track of how

For the class Employee example provided in tutorial 3.1.5, if for auditing purposes we needed to keep track of how many last name changes have been made for an employee, what code segments could implement this task?
def __init__( fname, lname, empid, title, sal):
lastname_changes =0
def set_lastname(lname):
if len(lname)>0:
lastname = lname
lastname_changes +=1
def get_lastname_changes():
return lastname_changes
def __init__(fname, lname, empid, title, sal):
self.lastname_changes =0
def set_lastname(lname):
if len(lname)>0:
self.lastname = lname
self.lastname_changes +=1
def get_lastname_changes():
return self.lastname_changes
def __init__(self, fname, lname, empid, title, sal):
self.lastname_changes =0
def set_lastname(self,lname):
if len(lname)>0:
self.lastname = lname
self.lastname_changes +=1
def get_lastname_changes(self):
return self.lastname_changes
def __init__(self, fname, lname, empid, title, sal):
lastname_changes =0
def set_lastname(self,lname):
if len(lname)>0:
lastname = lname
lastname_changes +=1
def get_lastname_changes(self):
return lastname_changes

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 Databases Questions!