from employee import Employee

class SalariedEmployee(Employee):
    """
    An employee whose pay is computed based on an annual salary.
        annual_salary: number  - This employee's annual salary
    """
    
    def __init__(self, eid, name, SIN, pay_period, annual_salary):
        """
        (Employee, int, str, int, str, number) -> NoneType
        
        >>> e = SalariedEmployee(14, 'Fred Flintstone', 454121883, \
        'weekly', 5200)
        >>> e.annual_salary
        5200
        """
        
        Employee.__init__(self, eid, name, SIN, pay_period)
        self.annual_salary = annual_salary     
        
    def amount_of_pay(self):
        """
        (Employee) -> float
        
        Return the amount that this Employee should be paid in the next
        pay period.
        
        >>> e = SalariedEmployee(14, 'Fred Flintstone', 454121883, \
        'weekly', 5200)
        >>> e.amount_of_pay()
        100.0
        >>> e = SalariedEmployee(99, 'Mr Slate', 999999999, 'monthly', \
        120000)
        >>> e.amount_of_pay()
        10000.0
        """
        
        if self.pay_period == "weekly":
            return self.annual_salary / 52
        else:
            return self.annual_salary / 12
        
if __name__ == '__main__':
    import doctest
    doctest.testmod()