Package solution
Class FullTime
java.lang.Object
solution.Employee
solution.FullTime
Represents a full time Employee with a salary.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Number of pay periods in a year. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getPay()
Returns the gross pay of the FullTime Employee which is the salary divided by the number of pay periods.protected String
Generates a String that can be added to the end of the paystub to show the breakdown of the payment which includes the gross and net pay, employee type, and any other relevant information like number of hours and rate for Hourly employees or salary for FullTime employees.toString()
Returns a String that displays the Employee information which include the ID, name, address, type, and salary.Methods inherited from class solution.Employee
equals, formatLine, formatLine, generatePayStub, getId, totalDeductions
-
Field Details
-
NUM_PAY_PERIODS
public static final int NUM_PAY_PERIODSNumber of pay periods in a year. Should be 24.- See Also:
-
-
Constructor Details
-
FullTime
public FullTime(int id, String name, String address, double salary, ArrayList<Deduction> deductions) throws IllegalArgumentException Creates a FullTime Employee.- Parameters:
id
- ID of the employeename
- Name of employeeaddress
- Address of the employeesalary
- Yearly salary.deductions
- ArrayList of Deductions for the Employee- Throws:
IllegalArgumentException
- if salary is less than or equal to zero.
-
-
Method Details
-
getPay
public double getPay()Returns the gross pay of the FullTime Employee which is the salary divided by the number of pay periods. -
toString
Returns a String that displays the Employee information which include the ID, name, address, type, and salary. -
paymentBreakdown
Description copied from class:Employee
Generates a String that can be added to the end of the paystub to show the breakdown of the payment which includes the gross and net pay, employee type, and any other relevant information like number of hours and rate for Hourly employees or salary for FullTime employees. The net pay is the gross pay minus the total deductions amount.- Specified by:
paymentBreakdown
in classEmployee
- Returns:
- String that breaks down the payment.
-