Write Class Named Newemp Sub Class Employee Class Project 9 Data Member Payrate 100 Overri Q37088606

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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.