Question: For the base class Person example provided in the Unit 3 Revisiting the Employee Class Program tutorial, if we need to add a subclass for
For the base class Person example provided in the Unit Revisiting the Employee Class Program tutorial, if we need to add a subclass for Volunteers who have a host employee and are assigned to a project, what code segment could implement this subclass and create an instance of it called volunteer
class Volunteer:
def initselffname,lnametitle,host,project:
superinitfnamelnametitle
self.host host
self.project project
def gethostself:
return "Host: strselfhost
def sethostselfnewhost:
self.host newhost
def getprojectself:
return "Project: strselfproject
def setprojectself project:
self.project project
volunteer VolunteerJohn'Doe','Volunteer','Jane Doe','ProjectX
class Volunteer:
def initselffname,lnametitle,host,project:
superinitfnamelnametitle,project
self.host host
self.project project
def gethostself:
return "Host: strhost
def sethostselfnewhost:
self.host newhost
def getprojectself:
return "Project: strproject
def setprojectself project:
self.project project
volunteer VolunteerJohn'Doe','Volunteer','Jane Doe','ProjectX
class VolunteerPerson:
def initselffname,lnametitle,host,project:
superinitfnamelnametitle, project
self.host host
self.project project
def gethostself:
return "Host: strselfhost
def sethostselfnewhost:
self.host newhost
def getprojectself:
return "Project: strselfproject
def setprojectself project:
self.project project
volunteer VolunteerJohn'Doe','Volunteer','Jane Doe','ProjectX
class VolunteerPerson:
def initselffname,lnametitle,host,project:
superinitfnamelnametitle
self.host host
self.project project
def gethostself:
return "Host: strselfhost
def sethostselfnewhost:
self.host newhost
def getprojectself:
return "Project: strselfproject
def setprojectself project:
self.project project
volunteer VolunteerJohn'Doe','Volunteer','Jane Doe','ProjectX
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
