-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.cpp
More file actions
104 lines (74 loc) · 2.04 KB
/
Employee.cpp
File metadata and controls
104 lines (74 loc) · 2.04 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include<iostream>
#include <utility>
#include "Employee.h"
using namespace std;
Employee::Employee() = default;
Employee::Employee(string EmpFirstName, string EmpLastName,
int EmpRating, string EmpNotes, int EmpSalary) {
firstName = std::move(EmpFirstName);
lastName = std::move(EmpLastName);
rating = EmpRating;
notes = std::move(EmpNotes);
salary = EmpSalary;
}
/*Destructor. cout used to show that destructor is called after
program has finished.*/
Employee::~Employee() {
cout << "destructor called" << endl;
}
//Setter and getter for Employee first name.
void Employee::setFirstName(string EmpFirstName) {
firstName = std::move(EmpFirstName);
};
string Employee::getFirstName() {
cout << firstName;
return firstName;
}
//Setter and getter for Employee last name.
void Employee::setLastName(string EmpLastName) {
lastName = std::move(EmpLastName);
}
string Employee::getLastName() {
return lastName;
}
//Setter and getter for Employee rating.
void Employee::setRating(int EmpRating) {
rating = EmpRating;
}
int Employee::getRating() const {
return rating;
}
//Setter and getter for Employee notes.
void Employee::setNotes(string EmpNotes) {
notes = std::move(EmpNotes);
}
string Employee::getNotes() {
return notes;
}
//Setter and getter for Employee salary.
void Employee::setSalary(int EmpSalary) {
salary = EmpSalary;
}
int Employee::getSalary() {
return salary;
}
//Functions
//Prints Employee information.
void Employee::printValues() {
cout << "Name: " << lastName << ", " << firstName << endl
<< "Salary: $" << salary << endl
<< "Rating: " << rating << endl
<< "Notes: "<< notes;
}
//Function to input Employee information.
void Employee::getEmpInfo() {
cout << "Enter Name: " << endl;
cin >> firstName >> lastName;
cout << "Enter Salary: " << endl;
cin >> salary;
cout << "Enter Efficiency Rating: " << endl;
cin >> rating;
cout << "Enter Notes: " << endl;
cin >> notes;
cout << endl;
}