Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

HourlyWorker Class Reference

#include <HourlyWorker.hpp>

Inheritance diagram for HourlyWorker::

Employee List of all members.

Public Methods

 HourlyWorker (const char *first, const char *last, double w, double h)
void setWage (double w)
void setHours (double h)
double earnings () const
void printName () const
void printInfo () const

Private Attributes

double wage
double hours

Constructor & Destructor Documentation

HourlyWorker::HourlyWorker const char *    first,
const char *    last,
double    w,
double    h
[inline]
 

Definition at line 7 of file HourlyWorker.cpp.

00013   : Employee( first, last ), wage( w ), hours( h ) { } 


Member Function Documentation

double HourlyWorker::earnings   const [inline, virtual]
 

Reimplemented from Employee.

Definition at line 26 of file HourlyWorker.cpp.

00026                                            { 
00027    if ( hours <= 40 ) {   // no overtime
00028       return wage * hours;
00029    } else {               // overtime is paid at wage * 1.5
00030       return 40 * wage + ( hours - 40 ) * wage * 1.5;
00031    } 
00032 }

void HourlyWorker::printInfo   const [inline]
 

Reimplemented from Employee.

Definition at line 41 of file HourlyWorker.cpp.

00042 {
00043    Employee::printName();
00044    cout << " is an hourly worker with pay of $"
00045         << setiosflags( ios::fixed | ios::showpoint )
00046         << setprecision( 2 ) << getPay() << endl;
00047 }

void HourlyWorker::printName   const [inline]
 

Reimplemented from Employee.

Definition at line 35 of file HourlyWorker.cpp.

00035                                           {
00036    cout << "\n    Hourly worker: ";
00037    Employee::print();
00038 }

void HourlyWorker::setHours double    h [inline]
 

Definition at line 21 of file HourlyWorker.cpp.

00021                                              {
00022    hours = h;
00023 }

void HourlyWorker::setWage double    w [inline]
 

Definition at line 16 of file HourlyWorker.cpp.

00016                                             {
00017    wage = w;
00018 }


Member Data Documentation

double HourlyWorker::hours [private]
 

Definition at line 22 of file HourlyWorker.hpp.

double HourlyWorker::wage [private]
 

Definition at line 21 of file HourlyWorker.hpp.


The documentation for this class was generated from the following files:
Generated on Sun Oct 14 18:48:38 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001