/*************************************************************************
 * Employee superclass 
 * It implements aPerson
 * However because it does not implement all methods in the interface,
 *     it must be declared as abstract
 *
 ************************************************************************/

public abstract class Employee implements APerson
{

    private static String companyName  = "XYZ inc.";     // class fields
    private static int    employeeCount;
    
    private String position;                             // instance fields
    private String lastname;
    private String firstname;
    private String sex;
    private int    age;

    /**
     * Constructors for objects of class Employee
     */

    Employee(String title)                              // first constructor
    {
        position       = title;
        employeeCount += 1;         
    }

    Employee(String title, String last, String first, String x, int old)   
    {
        this(title);                                    // call first constructor
                                                        // and pass it title
        lastname  = last;
        firstname = first;  
        sex       = x;
        age       = old;
    }

    /**
     * static and instance methods
     */

    public String getFirstname( )        
    {
        return (firstname);
    }
    public String getLastname( )        
    {
        return (lastname);
    }
    public String getGender( )                  //implements getGender()        
    {
        return (sex);
    }
    public int getAge( )                        //implements getSex()        
    {
        return (age);
    }

    public abstract int getWeekPay( );          //abstract method, must be
                                                //implemented in subclasses 

    public String toString ( )                  //toString method
    {
        String data = "Position: "   + position + 
                      "\t Name: "    + firstname +  " " + lastname +  
                      "\t Sex: "     + sex + "\t Age: " + age + 
                      "\t To Live: " + APerson.toLive() +
                      "   Earn$: "   + earnMoney(); 
        return data;        
    }
}