employee
Class Week

java.lang.Object
  extended by employee.Week

public class Week
extends java.lang.Object


Field Summary
static double FULL_TIME_HRS
          full time hours
static double MIN_WAGE
          minimum wage in PA starting in 2007
 
Constructor Summary
Week()
          Creates a new default instance of Week
Week(int num, double pay)
          creates a new instance of Week, given week num and pay rate
Week(int num, double pay, double hrs)
          creates a new instance of Week, given all info
 
Method Summary
 boolean addHoursWorked(double hrs)
          add to number of hours worked.
 double getHoursWorked()
          report hours worked
 double getPayEarned()
          report pay earned for the week
 double getPayRate()
          report pay rate
 int getWeekNum()
          report week number
 boolean setHoursWorked(double hrs)
          set hours worked to a specific value.
 boolean setPayRate(double pay)
          set pay rate to a specific value.
 boolean setWeekNum(int wk)
          set week number to a specific value.
 java.lang.String toString()
          produce a friendly string version of the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_WAGE

public static final double MIN_WAGE
minimum wage in PA starting in 2007

See Also:
Constant Field Values

FULL_TIME_HRS

public static final double FULL_TIME_HRS
full time hours

See Also:
Constant Field Values
Constructor Detail

Week

public Week()
Creates a new default instance of Week


Week

public Week(int num,
            double pay)
creates a new instance of Week, given week num and pay rate


Week

public Week(int num,
            double pay,
            double hrs)
creates a new instance of Week, given all info

Method Detail

getWeekNum

public int getWeekNum()
report week number


getPayRate

public double getPayRate()
report pay rate


getHoursWorked

public double getHoursWorked()
report hours worked


getPayEarned

public double getPayEarned()
report pay earned for the week


setWeekNum

public boolean setWeekNum(int wk)
set week number to a specific value. Accepts any positive integer value. Returns false if invalid.


setPayRate

public boolean setPayRate(double pay)
set pay rate to a specific value. Accepts any value greater than or equal to the minimum wage. Returns false if invalid.


setHoursWorked

public boolean setHoursWorked(double hrs)
set hours worked to a specific value. Accepts any value greater than zero and less than a ridiculous value (currently 100). Returns false if invalid.


addHoursWorked

public boolean addHoursWorked(double hrs)
add to number of hours worked. Useful if putting in hours day by day as the week goes on. Accepts any positive value less than a rediculous value (currently 16 - a double shift). Returns false if invalid.


toString

public java.lang.String toString()
produce a friendly string version of the object

Overrides:
toString in class java.lang.Object