/* * @(#)Staff.java 1.0 3 December 2002 * *

A class to represent a staff member.

* @author Viera K. Proulx * (modified by Sharon Tuttle, 2-11-03) */ public class Staff extends APerson { /*------------------------------------------------------------------------ fields -------------------------------------------------------------------------*/ /* This employee's hourly wage. */ double payRate; /*------------------------------------------------------------------------ constructor -------------------------------------------------------------------------*/ Staff(String aName, int aDOB, String aDept, double rateOfPay) { this.setName(aName); this.setDob(aDOB); this.setDepartment(aDept); this.payRate = rateOfPay; } /*-------------------------------------------------------------------- accessor --------------------------------------------------------------------*/ double getPayRate() { return this.payRate; } /*--------------------------------------------------------------------- overridden methods ---------------------------------------------------------------------*/ public String toString() { return("Instructor(" + this.getName() + ", " + this.getDob() + ", " + this.getDepartment() + ", $" + payRate + " per hour)"); } /*------------------------------------------------------------------------ other methods: ------------------------------------------------------------------------*/ /*----------------------------------------------------------------------- Purpose: to determine this person's pay given the hours worked someHours ------------------------------------------------------------------------*/ double computePay(int someHours) { return (this.payRate * someHours); } }