#======================================================================================
# The Employee class
#======================================================================================
class Employee:

    companyName   = "XYZ inc."                      # static variables
    employeeCount = 0                               # belong to the class as a whole


    def __init__(self, title,last,first,sex,old):   # constructor
        
        self.position   = title                     # instance variables
        self.lastname   = last                      # belong to each object
        self.firstname  = first
        self.sex        = sex
        self.age        = old
        
        Employee.employeeCount += 1;


    @staticmethod                                       # indicates static method
    def getEmployeeCount() :                            # static method
        return (Employee.employeeCount)                 # belongs to the class as a whole

    @staticmethod                                       # indicates static method
    def companyInfo() :                                 # static method
        print("Company    " , Employee.companyName)
        print("Empl count " , Employee.employeeCount)
#or     print("Empl count " , Employee.getEmployeeCount())


    def getFullname (self, salutation) :                              # instance method
        name  = salutation +" "+ self.firstname +" "+ self.lastname   # belongs to each object
        return (name)


    # Every object should ("best practice") have a __str__( ) method.
    # The __str__ ( ) method should return the content of the object in one long string 
    # If you use the object in any string context (e.g. printing), the __str__( ) method  
    #   will automatically be called.  We will cover this in more detail later

    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)