Package username
Class FullTime
java.lang.Object
username.Employee
username.FullTime
Represents a full time Employee with a salary.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetPay()Returns the gross pay of the FullTime Employee which is salary divided by 24, which is the number of pay periods.doubleprotected StringReturns a String that breaks down the payment for the FullTime employee.toString()Returns a String representation of the FullTime Employee.Methods inherited from class username.Employee
formatLine, generatePayStub, getId, totalDeductions
-
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 employeename- Name of employeeaddress- Address of the employeesalary- 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. -
toString
Returns a String representation of the FullTime Employee. -
paymentBreakdown
Returns a String that breaks down the payment for the FullTime employee.- Specified by:
paymentBreakdownin classEmployee- Returns:
- String that contains the salary, gross pay, and net pay of the employee formatted nicely.
-