-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshow.cpp
More file actions
106 lines (74 loc) · 2.19 KB
/
show.cpp
File metadata and controls
106 lines (74 loc) · 2.19 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#include <type.h>
int showDormitoryInfo (void *){
system("cls");
cout << "---------Dormitory Information--------"<<endl;
if (root == NULL)
cout << "Tree was not created!\n";
else{
cout << " Dormitory addres is: ";
cout << root->Addres<<endl;
cout << " Build year: ";
cout << root->buildYear<<endl;
cout << " Commandant: ";
cout << root->Commandant<<endl;
}
pause();
return 0;
}
int showBlockInfo (void *ptr){
Block *pB = (Block*)ptr;
system("cls");
cout << "--- Block Information ----\n";
cout << " Number of Block: " << pB->Numblock<<endl;
cout << " Floor of Block: " << pB->Floor<<endl;
cout << " Starosta: " << pB->Starosta<<endl;
pause();
return 0;
}
int showRoomInfo (void *ptr){
Room *pR = (Room*)ptr;
system("cls");
cout << "----- Block " << pR->parent->Numblock<<"----\n";
cout << " Number of Room: " << pR->NumberRoom << endl;
cout << " Kilkist lizok: " << pR->KilkistLizok << endl;
cout << " Square: " << pR->Square << endl;
pause ();
return 0;
}
int showInhabInfo (void *ptr){
if (ptr == NULL)return 1;
Inhabitant *pI = (Inhabitant*)ptr;
system("cls");
cout << "---Block "<<pI->parent->parent->Numblock <<"---\n";
cout << "---Room " << pI->parent->NumberRoom <<"---\n";
cout << " Inhabitant name: " << pI->name << endl;
cout << " Year to room: " << pI->YeartoRoom << endl;
cout << " Facult: " << pI->Facult << endl;
pause();
return 0;
}
int showBlockList (void *ptr){
system ("cls");
cout << "----List of block ----"<<endl;
printBlockList();
pause();
return 0;
}
int showRoomList (void *ptr){
Block *pB = (Block*)ptr;
system("cls");
cout << "\tBlock "<< pB->Numblock << endl;
cout << "\tList of Room\n";
printRoomList(pB);
pause();
return 0;
}
int showInhabList (void *ptr){
system("cls");
Room *r = (Room*)ptr;
cout <<"\tRoom " << r->NumberRoom <<endl;
cout <<"\tList of inhabitant \n";
printInhabList(r);
pause();
return 0;
}