Write class named Newemp that is a sub class of the EmployeeClass From Project 9
It will have a data member :
payrate = 100
override the emppay() member method:
self.pay = self.hours * self.payrate
Project 9
#constructor
class Employee:
def __init__(self, name=””, pay=0.0, hours=0):
self.name = name
self.pay = pay
self.hours = hours
#get
def getName(self):
return self.name
def getPay(self):
return self.pay
def getHours(self):
return self.hours
#set
def setName(self, name):
self.name = name
def setPay(self, pay):
self.pay = pay
def setHours(self, hours):
self.hours = hours
#mutator method
def emppay(self):
self.pay = self.hours * 80
Solution
class Newemp(Employee): def __init__(self, prate): self.payrate = prate def emppay(self): self.pay =
OR
OR