Package username

Class FullTime


public class FullTime extends Employee
Represents a full time Employee with a salary.
  • Constructor Details

    • FullTime

      public FullTime(int id, String name, String address, double salary, List<Deduction> deductions) throws IllegalArgumentException
      Creates a FullTime Employee.
      Parameters:
      id - ID of the employee
      name - Name of employee
      address - Address of the employee
      salary - Yearly salary.
      deductions - List of Deductions for the Employee
      Throws:
      IllegalArgumentException - if salary is less than or equal to zero.
  • Method Details

    • getSalary

      public double getSalary()
    • getPay

      public double getPay()
      Returns the gross pay of the FullTime Employee which is salary divided by 24, which is the number of pay periods.
      Specified by:
      getPay in class Employee
      Returns:
      Gross pay of the Employee.
    • toString

      public String toString()
      Returns a String representation of the FullTime Employee.
      Overrides:
      toString in class Employee
      Returns:
      String with the ID, name, address, type, and salary of the Employee.
    • paymentBreakdown

      protected String paymentBreakdown()
      Returns a String that breaks down the payment for the FullTime employee.
      Specified by:
      paymentBreakdown in class Employee
      Returns:
      String that contains the salary, gross pay, and net pay of the employee formatted nicely.