Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started