-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsupervisor.cpp
More file actions
40 lines (33 loc) · 1.18 KB
/
supervisor.cpp
File metadata and controls
40 lines (33 loc) · 1.18 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
/** File supervisor.cpp
*
* @author Nathaniel Miller
*
* Class Supervisor definitions.
* Holds functions associated with the Supervisor class.
*/
#include "supervisor.h"
#include "empl.h"
/* default constructor for a supervisor object, with empty fields */
Supervisor::Supervisor() {
department = ""; // initially empty
subordinates = 0; // initally zero
}
/* creates a supervisor object with the given parameters as data,
* calls the Employee base-class constructor explicitly.
*/
Supervisor::Supervisor(string emp_name, int salary, string dept, int subords)
: Employee(emp_name, salary)
{
department = dept; // set the supervisor's department field
subordinates = subords; // set the supervisor's subordinates field
}
/* prints a supervisor object */
void Supervisor::print_super() {
cout << "Supervisor's name: " << name << " Department: " << department <<
" Subordinates: " << subordinates << " Salary: " << salary << endl;
}
/* prints a supervisor object, virtual declaration version */
void Supervisor::printv() {
cout << "Supervisor's name: " << name << " Department: " << department <<
" Subordinates: " << subordinates << " Salary: " << salary << endl;
}