-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.cpp
More file actions
32 lines (26 loc) · 810 Bytes
/
Copy pathEmployee.cpp
File metadata and controls
32 lines (26 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "Employee.h"
#include <iostream>
using namespace std;
Employee::Employee() {
ID = years = hoursWorked = hourlyRate = -1;
}
Employee::Employee(int ID, int years, double hourlyRate, float hoursWorked) {
this->ID = ID;
this->years = years;
this->hourlyRate = hourlyRate;
this->hoursWorked = hoursWorked;
}
void Employee::print() {
cout << "Printing information for employee " << ID << ":\n Years Employed: " << years
<< "\n Hourly Rate: " << hourlyRate << "\n Hours Worked: " << hoursWorked
<< endl;
}
void Employee::anniversary() {
years++;
hourlyRate = hourlyRate + hourlyRate * .002;
cout << "Congratulations to employee " << ID << " on " << years << " year(s) at company!"
<< endl;
}
double Employee::calculatePay() {
return hourlyRate * hoursWorked;
}