This Looks Like a Job For


#1



class Employee(object):
    """Models real-life employees!"""
    def __init__(self, employee_name):
        self.employee_name = employee_name

    def calculate_wage(self, hours):
        self.hours = hours
        return hours * 20.00

# Add your code below!
class PartTimeEmployee(Employee):
    def calculate_wage(self, hours):
        self.hours = hours
        return hours * 12.00
    def full_time_wage(self,hours):
        return super(PartTimeEmployee, self).calculate_wage(1)
milton=PartTimeEmployee("rajat")
print milton.full_time_wage(10)


#2

"""please help me in correcting this code.."""


#3

here:

return super(PartTimeEmployee, self).calculate_wage(1)

why do you give calculate_wage an argument value of 1?

then the argument you supply here:

print milton.full_time_wage(10)

doesn't matter (while it should matter), use the method parameter hours instead of 1 when calling parent class method with super


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.