-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.cpp
More file actions
28 lines (24 loc) · 793 Bytes
/
Employee.cpp
File metadata and controls
28 lines (24 loc) · 793 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
#include <iostream>
#include <sstream>
#include "Employee.h"
#include "Date.h"
using namespace std;
Employee::Employee(const string& first, const string& last,
const Date& dateOfBirth, const Date& dateOfHire)
: firstName{ first },
lastName{ last },
birthDate{ dateOfBirth },
hireDate{ dateOfHire } {
cout << "Employee object constructor: "
<< firstName << ' ' << lastName << endl;
}
string Employee::toString() const {
ostringstream output;
output << lastName << ". " << firstName << " Hired: "
<< hireDate.toString() << " Birthday: " << birthDate.toString();
return output.str();
}
Employee::~Employee() {
cout << "Employee object deconstructor: "
<< lastName << ", " << firstName << endl;
}