// Hourly.cpp #include #include #include "Hourly.h" // costruttore di HourlyWorker HourlyWorker::HourlyWorker( string first, string last, double initHours, double initWage ) : Employee( first, last ) // chimata al costruttore base { hours = initHours; // dovrebbe essere validata ... wage = initWage; // dovrebbe essere validata ... } // calcola e ritorna stipendio double HourlyWorker::getPay() const { return wage * hours; } // stampa nome, cognome e paga void HourlyWorker::print() const { //cout << "HourlyWorker::print() e' in esecuzione\n"; this->Employee::print(); // chiamata al metodo di stampa della // classe base per l'oggetto interno cout << " e' un Hourly Worker con paga di $" << setiosflags( ios::fixed | ios::showpoint ) << setprecision( 2 ) << getPay() << endl; }