# worker.py
# Walker M. White (wmw2), Steve Marschner (srm2), Anne Bracy
# March 27, 2018
"""Module with a simple Worker class.

Class demonstrates attributes and a constructor."""


class Worker():
    """Instance is a worker in a certain organization
    
    Instance variables:
       lname: Last name.  [str]
       ssn:   Social security no. [int in 0..999999999]
       boss:  The worker's boss. [Worker, or None if no boss]
    """
    
    def __init__(self, lname, ssn, boss):
        """Intializer: instance with last name n, soc sec number s, and boss b.
        
        Parameter lname: Worker's last name
        Precondition: lname is a string
        
        Parameter ssn: Worker's social security no.
        Precondition: ssn is an int in 0..999999999
        
        Parameter boss: Worker's boss
        Precondition: boss is a Worker, or None"""
        self.lname = lname
        self.ssn   = ssn
        self.boss  = boss
    
    def __str__(self):
        """Returns: text representation of this Worker"""
        return ('Worker ' + self.lname +
                '. Soc sec XXX-XX-' + str(self.ssn % 10000) +
                ('.' if self.boss is None else '. boss: ' + self.boss.lname))