1
0
Fork 0
school/cs142/final/hourly.cpp

20 linhas
462 B
C++

#include "hourly.h"
#include "employee.h"
using namespace std;
hourly::hourly(string name, double pay_rate, int hours, string type) : employee(name, pay_rate, hours, type) {}
int hourly::get_salary() {
int salary;
int overtime;
if((hours - 170) > 0) {
overtime = (hours - 170);
salary = 170 * pay_rate;
salary += overtime * (pay_rate * 1.5);
return salary;
}
salary = hours * pay_rate;
return salary;
}