Class Payee

java.lang.Object
  extended by Payee

public class Payee
extends java.lang.Object

The Payee class calculates payroll for regular and overtime workers. Updates data fields by calling the setHoursWorked() and setPayRate() methods.

Version:
CST141 - Fall 2013
Author:
Carl B. Struck

Constructor Summary
Payee()
          No parameter constructor for objects of class Payee.
Payee(double hoursWorked, double payRate)
          Constructor for objects of class Payee with parameters that initialize the hours worked and pay rate data fields.
 
Method Summary
 double getGrossPay()
          Calculates and returns employee gross pay.
 double getHoursWorked()
          Accessor method for the hours worked data field.
 double getPayRate()
          Accessor method for the pay rate data field.
 void printPayee()
          Print method for Payee state.
 void setHoursWorked(double hoursWorked)
          Mutator method for the hours worked data field.
 void setPayRate(double payRate)
          Mutator method for the pay rate data field.
 
Methods inherited from class
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Payee

public Payee()
No parameter constructor for objects of class Payee. Initializes the hours worked and pay rate data fields to default values of zero (0).


Payee

public Payee(double hoursWorked,
             double payRate)
Constructor for objects of class Payee with parameters that initialize the hours worked and pay rate data fields.

Parameters:
hoursWorked - the employee number of hours worked
payRate - the employee hourly rate of pay
Method Detail

getGrossPay

public double getGrossPay()
Calculates and returns employee gross pay. If hours worked is greater than 40, calculates overtime pay.

Returns:
Employee gross pay as a double

getHoursWorked

public double getHoursWorked()
Accessor method for the hours worked data field.

Returns:
Employee number of hours worked as a double

getPayRate

public double getPayRate()
Accessor method for the pay rate data field.

Returns:
Employee hourly rate of pay as a double

printPayee

public void printPayee()
Print method for Payee state.


setHoursWorked

public void setHoursWorked(double hoursWorked)
Mutator method for the hours worked data field. Validates that hours worked is between 0.25 and 60.0.

Parameters:
hoursWorked - the employee number of hours worked

setPayRate

public void setPayRate(double payRate)
Mutator method for the pay rate data field. Validates that pay rate is between 7.50 and 75.00.

Parameters:
payRate - the employee hourly rate of pay