Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I keep getting the error code missing 1 required positional argument: 'self' can you help me fix it ? #Creating employee class class employee: def

I keep getting the error code "missing 1 required positional argument: 'self' can you help me fix it?
#Creating employee class
class employee:
def _init_(self, name, employeeGender,employeeHourlyRate, employeeNumber):
self.name = name
self.employeeGender= employeeGender
self.employeeHourlyRate= employeeHourlyRate
self.employeeNumber= employeeNumber
def get_name(self):
return self.name
def set_name(self, name):
self.name= name
def get_employeeGender(self):
return self.employeeGender
def set_employeeGender(self, employeeGender):
self.employeeGender= employeeGender
def get_employeeHourlyRate(self):
return self.employeeHourlyRate
def set_employeeHourlyRate(self, employeeHourlyRate):
self.employeeHourlyRate= employeeHourlyRate
def set_employeeNumber(self):
return self.employeeNumber
def get_employeeNumber(self):
self.employeeNumber= employeeNumber
#creating productionworker class
class productionWorker(employee):
def _init_(self, name, employeeGender,employeeHourlyRate, employeeNumber, employeeShiftNumber):
super()._init_(self, name, employeeGender,employeeHourlyRate, employeeNumber)
self.employeeShiftNumber= employeeShiftNumber
def get_employeeShiftNumber(self):
return self.employeeShiftNumber
def set_employeeShiftNumber(self, employeeShiftNumber):
self.employeeShiftNumber= employeeShiftNumber
#accessing and modifying info
print("Employee name:", productionWorker.get_name())
print("Employee Gender: ", prodcutionWorker.get_employeeGender())
print("Employee Hourly Rate: ", productionWorker.get_employeeHourlyRate())
print("Employee Number: ", productionWorker.get_employeeNumber())
print("Employee Shift Number: ", productionWorker.get_employeeShiftNumber())
productionWorker.set_name("Denise Bazan")
productionWorker.set_employeeGender("Female")
productionWorker.set_employeeHourlyRate("$18")
productionWorker.set_employeeNumber("214404")
productionWorker.set_employeeShiftNumber("3")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago