-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLeader.h
54 lines (52 loc) · 1.12 KB
/
Leader.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
#ifndef LEADER_H_INCLUDED
#define LEADER_H_INCLUDED
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;
class Leader:virtual public Staff
{
protected:
char job[12];
char dep[12];
public:
Leader(){ type = 'L'; next = NULL;};
virtual ~Leader(){}
void Input()
{
cout << "编号:";
cin >> num;
cout << "姓名:";
cin >> name;
cout << "年龄:";
cin >> age;
cout << "职务:";
cin >> job;
cout << "部门:";
cin >> dep;
}
void Show()
{
cout << setw(8) << num << setw(12) << name << setw(5) << age << setw(12) << job << setw(12) << dep << endl;
}
void SaveRecord(FILE *fp)
{
fprintf(fp,"%c\n%s\n%s\n%s\n%s\n%s ",type,num,name,age,job, dep);
}
void loadFile(char ch,FILE *fp)
{
type = ch;
fscanf(fp,"%s%s%s%s%s",num,name,age,job,dep);
Show();
}
void Updete()
{
cout<<"原先的数据:"<<endl;
Show();
cout<<"请从新输入数据"<<endl;
Input();
}
};
#endif // LEADER_H_INCLUDED