// Programs from class are posted on the lecture summaries webpage.

/** An instance is a worker in a certain organization */
public class Worker {
     private String lname; // Last name. Never null, use ""
                           // if it's unknown
     private int ssn;      // Social security no.
                           // in 0..999999999
     private Worker boss;  // The worker's boss --null if none
    
     /* Class invariant: the collection of meaning of fields and
        constraints on them, written as comments on the field as above */
     
     /** Constructor: an instance with last name n, soc sec
            number s, and boss b.
         Precondition: n is not null; use "" if unknown
                       s is in 0..999999999
                       b is null if this Worker has none */
     public Worker(String n, int s, Worker b) {
         lname= n;
         ssn= s;
         boss= b;
     }
 
     
     /** = the last name of this worker */
     public String getLname() {
         return lname;
     }
     
     /** = the boss of this worker */
     public Worker getBoss() {
         return boss;
     }
     
     /** = last 4 digits of soc sec number */
     public int getSsn() {
         return ssn % 10000;
     }
}