#======================================================================================
# The Employee class - 
# hiding the attributes, and providing getters and setters
# Extendinhg the superclass
#======================================================================================
class Employee:

    __companyName   = "XYZ inc."                      # static attributes
    __employeeCount = 0                               # belong to the class as a whole


    def __init__(self, title,last,first,sex,old):     # constructor
        
        self.__position  = title                      # instance attributes
        self.__lastname  = last                       # belong to each object
        self.__firstname = first
        self.__sex       = sex
        self.__age       = old
        
        Employee.__employeeCount += 1;


    @staticmethod
    def getCompanyName() :                              # static getter method
        return (Employee.__companyName)                 

    @staticmethod
    def getEmployeeCount() :                            # static getter method
        return (Employee.__employeeCount)               

    @staticmethod 
    def setCompanyName(newname) :                       # static setter method
        Employee.__companyName = newname               

    @staticmethod                                       
    def companyInfo() :                                 
        print("Company    " , Employee.__companyName)
        print("Empl count " , Employee.__employeeCount)
#or     print("Empl count " , Employee.getEmployeeCount())


    def getPosition(self) :                             # instance getter method
        return (self.__position)

    def getLastname(self) :                             # instance getter method
        return (self.__lastname)

    def getFirstname(self) :                            # instance getter method
        return (self.__firstname)

    def getSex(self) :                                  # instance getter method
        return (self.__sex)

    def getAge(self) :                                  # instance getter method
        return (self.__age)

    def setPosition(self, title) :                      # instance setter method
        self.__position = title

    def setLastname(self, last) :                       # instance setter method
        self.__lastname = last

    def setFirstname(self, first) :                     # instance setter method
        self.__Firstname = first

    def setSex(self, sex) :                             # instance setter method
        self.__sex = sex

    def setAge(self, old) :                             # instance setter method
        self.__age = old

    def getFullname (self) :                            # instance method
        if self.__sex == 'M':
            salutation = "Mr."
        else:
            salutation = "Ms."
        name  = salutation +" "+ self.__firstname +" "+ self.__lastname     # belongs to each object
        return (name)


    def __str__(self) :                                                     # instance method
        data  = "    Company "  + Employee.__companyName + \
                "\t Position: " + self.__position  + \
                "\t Name: "     + self.__firstname +  " " + self.__lastname + \
                "\t Sex: "      + self.__sex       + \
                "\t Age: "      + str(self.__age)
        return (data)