Create the main method using pythone to test the classes. #Create the class personType from matplotlib.pyplot import phase_spectrum
1. Create the main method using pythone to test the classes.
#Create the class personType
from matplotlib.pyplot import phase_spectrum
class personType:
#create the class constructor
def __init__(self,fName,lName):
#Initialize the data members
self.fName = fName
self.lName = lName
#Method to access
def getFName(self):
return self.fName
def getLName(self):
return self.lName
#Method to manipulate the data members
def setFName(self,fName):
self.fName = fName
def setLName(self,lName):
self.lName = lName
#Create the class Doctor Type inherit from personType
class doctorType(personType):
#Create the constructor for the doctorType class
def __init__(self, fName, lName,speciality="unknown"):
super().__init__(fName, lName)
self.speciality = speciality
#Methods to access
def getSpeciality(self):
return self.speciality
#Methods to manipulate
def setSpeciality(self,spc):
self.speciality = spc
#create the class billType
class billType():
#Create the constructor for the billType class
def __init__(self,pId, pCharges):
#Initialize the data members
self.pId = pId
self.pCharges = pCharges
#Methods to access
def getpId(self):
return self.pId
def getpChares(self):
return self.pCharges
#Methods to manipulate
def setpId(self,id):
self.pId = id
def setpCharges(self,charges):
self.pCharges = charges
#Create the class Datetype
class dateType():
#create the constructor by initializing the parameters
def __init__(self,pDob,dAdmitted,dDischarged):
self.pDob = pDob
self.dAdmitted = dAdmitted
self.dDischaged = dDischarged
#Create the class patientType inherited from personType
class patientType(personType):
#Create the constructor for the patientType class
def __init__(self, fName, lName,pId,pAge,pDob,phyfName,phylName,dAdmitted,dDischarged):
super().__init__(fName, lName)
self.pId = pId
self.pAge = pAge
#Store the date Info in the dateType class
self.dateInfo = dateType(pDob,dAdmitted,dDischarged)
#use the doctorType class to store the physician Name
self.doctorInfo = doctorType(phyfName,phylName)
#Methods for the manipulation and access
def getpId(self):
return self.pId
def getpAge(self):
return self.pAge
def getPhyfName(self):
return self.doctorInfo.getFName()
def getPhylName(self):
return self.doctorInfo.getLName()
def getdAdmitted(self):
return self.dateInfo.dAdmitted
def getdDischarged(self):
return self.dateInfo.dDischaged
def getdDob(self):
return self.dateInfo.pDob
def setpId(self,id):
self.pId = id
def setpAge(self,age):
self.pAge = age
def setpDob(self,Dob):
self.dateInfo.pDob = Dob
def setphyFName(self,fName):
self.doctorInfo.setFName(fName)
def setphyLName(self,lName):
self.doctorInfo.setLName(lName)
def setdAttended(self,date):
self.dateInfo.dAdmitted = date
def setdDischarged(self,date):
self.dateInfo.dDischaged = date
Step by step
Solved in 2 steps