-
Notifications
You must be signed in to change notification settings - Fork 0
/
Employee.h
36 lines (31 loc) · 907 Bytes
/
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
#ifndef EMPLOYEE_H_INCLUDED
#define EMPLOYEE_H_INCLUDED
#include<iostream>
#include<string.h>
#include<fstream>
using namespace std;
class Employee
{
protected:
char name[100];
int code;
char designation[100];
int exp;
int age;
int workingHours;
char anyLoan;
public:
Employee() {}
Employee(const char *name, int code, const char *designation, int exp, int age, int workingHours, char anyLoan = 'N')
: code(code), exp(exp), age(age), workingHours(workingHours), anyLoan(anyLoan)
{
strcpy(this->name, name);
strcpy(this->designation, designation);
}
virtual void calculateSalary() = 0;
virtual void save(ofstream &file) = 0;
virtual void load(ifstream &file) = 0;
int getCode() const { return code; }
const char *getName() const { return name; }
};
#endif // EMPLOYEE_H_INCLUDED