#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;
}
