#======================================================================================
# The PartTimer class - 
# Extends the Employee class
# Override the getFullname() method
#======================================================================================
import sys                                              
sys.path.insert(0,'/home/s/sultans/web/python/demo/oo/employee')
from Employee import Employee

class PartTimer(Employee):                            # PartTimer class extends Employee superclass

    __pensionPlan = False;                                          #add class attributes
     
    def __init__(self, title, last, first, x, old, hours, rate):    #constructor    
     
        super().__init__(title, last, first, x, old)                #call the superclass constructor
        self.__numHours   = hours                                   #add instance attributes                                
        self.__hourlyRate = rate 

    def getFullname (self) :                                        # override the getFullname
        if self.getSex() == 'M':                                    # of the Employee class
            salutation = "Mr."
        else:
            salutation = "Ms."
        name  = salutation +" "+ self.getFirstname() +" "+ self.getLastname()     
        name += "\t Sex="  +" "+ self.getSex() + " (temp)"  
        return (name)

    def __str__(self) :                                             # instance method
        data  = super().__str__()                                   #call the superclass __str__()
        data += "\t # of hours: "  + str(self.__numHours) + \
                "\t hourly rate: " + str(self.__hourlyRate)                
        return (data)