#include <HourlyWorker.hpp>
Inheritance diagram for HourlyWorker::
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 |
|
Definition at line 7 of file HourlyWorker.cpp. |
|
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 } |
|
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 } |
|
Reimplemented from Employee. Definition at line 35 of file HourlyWorker.cpp. 00035 { 00036 cout << "\n Hourly worker: "; 00037 Employee::print(); 00038 } |
|
Definition at line 21 of file HourlyWorker.cpp. 00021 { 00022 hours = h; 00023 } |
|
Definition at line 16 of file HourlyWorker.cpp. 00016 { 00017 wage = w; 00018 } |
|
Definition at line 22 of file HourlyWorker.hpp. |
|
Definition at line 21 of file HourlyWorker.hpp. |