-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemployee.h
66 lines (55 loc) · 1.31 KB
/
employee.h
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
63
64
65
66
#ifndef _EMPLOYEE_H
#define _EMPLOYEE_H
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <stdlib.h>
using namespace std;
class employee
{
/* Employee class to contain employee data
*/
private:
string surname;
double hourlyRate;
int empNumber;
public:
employee()
{
hourlyRate = -1;
empNumber = -1;
surname = "";
}
employee(const employee &other) :
surname(other.surname),
hourlyRate(other.hourlyRate),
empNumber(other.empNumber)
{
hourlyRate = other.hourlyRate;
empNumber = other.empNumber;
surname = other.surname;
}
void setEmployee(const string &name, double rate, int num)
{
surname = name;
hourlyRate = rate;
empNumber = num;
}
const string& getSurname() const
{
return surname;
}
void printEmployee()
{
cout << fixed << setprecision(2);
cout << setw(20) << left << surname << setw(4) << empNumber << " " << hourlyRate << "\n";
}
void loadEmployee(ifstream &fin)
{
//fin << surname;
//fin << hourlyRate;
//fin << empNumber;
}
};
#endif