class Searchable public virtual search_up virtual search_down class Un

 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
class Searchable {
public:
virtual search_up() = 0;
virtual search_down() = 0;
};
class Unit : public Searchable {
protected:
int ID;
String name;
long phone_number;
public:
virtual void get_name() = 0;
virtual void set_name() = 0;
virtual void get_phone_number() = 0;
virtual void set_phone_number() = 0;
virtual void get_ID() = 0;
virtual void set_ID(max(ID) + 1) = 0;
};
class Person : public Unit {
String* manager;
String* Subordinates[];
public:
void get_manager();
void get_subordinates();
void addSubordinate(String *Person);
void removeSubordinate(String *Person);
};
class Department : public Unit {
String* Upper_Level;
String* Lower_Level;
String* Manager;
long* Phones[];
public:
void get_...();
void set_...();
void addPhone[];
void removePhone[];
};
class Summary {
//многомерный массив указателей - 1 уровень, второй уровень итд...
};