-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNurses.cpp
More file actions
62 lines (54 loc) · 1.45 KB
/
Nurses.cpp
File metadata and controls
62 lines (54 loc) · 1.45 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Nurses.cpp
*
* Created on: 30 oct. 2013
* Author: grosalex
*/
#include "Nurses.h"
double Nurses::evening_overtimepay = 10;
double Nurses::night_overtimepay = 20;
Nurses::Nurses():Personnel() {
double inBiweeklySalary;
string inWorkShift;
cout << "Enter the biweekly Salary : ";
cin >> inBiweeklySalary;
cout << "Enter the work shift : ";
cin >> inWorkShift;
biweeklysalary=inBiweeklySalary;
work_shift=inWorkShift;
}
Nurses::Nurses(string inName, string inAddress, Date inBirthDate,
string inSocialAssurance, Date inEmploymentDate,
double inBiweeklySalary, string inWorkShift) : Personnel(inName,inAddress, inBirthDate, inSocialAssurance,inEmploymentDate) {
biweeklysalary=inBiweeklySalary;
work_shift=inWorkShift;
}
Nurses::~Nurses() {
// TODO !CodeTemplates.destructorstub.tododesc!
}
void Nurses::print() {
Personnel::print();
cout << "\nWork Shift : " << work_shift << endl;
cout << "Earnings : $" << earnings();
}
double Nurses::getBiweeklysalary() const {
return biweeklysalary;
}
void Nurses::setBiweeklysalary(double biweeklysalary) {
this->biweeklysalary = biweeklysalary;
}
const string& Nurses::getWorkShift() const {
return work_shift;
}
void Nurses::setWorkShift(const string& workShift) {
work_shift = workShift;
}
double Nurses::earnings() {
if(work_shift=="night"){
return biweeklysalary+night_overtimepay;
}
else if(work_shift=="evening"){
return biweeklysalary+evening_overtimepay;
}
else return biweeklysalary;
}