-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBMS.cpp
More file actions
278 lines (252 loc) · 6.92 KB
/
Copy pathBMS.cpp
File metadata and controls
278 lines (252 loc) · 6.92 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
string name;
int prize;
int members;
string contact;
string combine_name(int a, string b) {
return to_string(a) + " " + b + ".txt";
}
void intro() {
cout << "************************************************************************************************************************\n";
cout << "********************************************** Boarding Management System **********************************************\n";
cout << "************************************************************************************************************************\n\n";
cout << "This console-based boarding management system bridges the gap between boarding owners and boarding finders. Boarding finders can easily search for the best boardings based on their requirements, while boarding owners can add and update their boarding details. This user-friendly application streamlines the boarding search and booking process for a convenient and efficient experience.\n";
cout << "\n\tCreated by\t: Name 1\n\t\t\t: Name 2\n\t\t\t: Name 2\n";
cout << "\n\tPress enter to begin......";
cin.ignore();
}
void finder() {
system("cls");
int members;
cout << "\n\tNumber of members including yourself?";
cout << "\n\t\t1) One\n\t\t2) Two\n\t\t3) Three\n\t\t4) Four\n\t\t5) Five\n\t\t6) Six\n\t\t7) Seven\n\t\t8) Eight\n\t\t9) Ten\n\n\tSelect your answer (1,2,....,10): ";
cin >> members;
switch (members)
{
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
default:
break;
}
system("cls");
int Fee_int;
cout << "\n\tMonthly boarding fee that you can spend (For one person)?";
cout << "\n\t\t1) 1000 LKR - 3500 LKR \n\t\t2) 3500 LKR - 6500 LKR \n\t\t3) 6500 LKR - 8500 LKR\n\t\t4) 8500 LKR - 10500 LKR\n\t\t5) 10500 LKR - 12500 LKR\n\t\t6) 14500 LKR - 16500 LKR\n\t\t7) 16500 LKR - 17500 LKR\n\t\t8) 17500 LKR - 19500 LKR\n\t\t9) 19500 LKR - 21500 LKR\n\n\tSelect your answer (1,2, .... ,9): ";
cin >> Fee_int;
switch (Fee_int)
{
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
default:
break;
}
system("cls");
int Food;
cout << "\n\tInclude meals in boarding?";
cout << "\n\t\t1) Yes \n\t\t2) No \n\n\tSelect your answer (1/2):";
cin >> Food;
switch (Food)
{
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
default:
break;
}
}
void owner() {
system("cls");
fstream myfile;
//string contact;
//string name;
cout << "\n\tName\t\t: ";
cin >> name;
cout << "\n\n\tContact Number\t: ";
cin >> contact;
system("cls");
//int members;
cout << "\n\tAvailable space\t: ";
cout << "\n\t\t1) One\n\t\t2) Two\n\t\t3) Three\n\t\t4) Four\n\t\t5) Five\n\t\t6) Six\n\t\t7) Seven\n\t\t8) Eight\n\t\t9) Ten\n\n\tSelect your answer (1,2,....,10): ";
cin >> members;
system("cls");
//int prize;
cout << "\n\tMonthly prize per person\t: ";
cin >> prize;
switch (members)
{
case 1:
myfile.open(combine_name(members, name), ios::out);
if (myfile.is_open())
{
myfile << name <<"\n";
myfile << contact << "\n";
myfile << members << "\n";
myfile << prize << "\n";
myfile.close();
}
break;
case 2:
myfile.open(combine_name(members, name), ios::out);
if (myfile.is_open())
{
myfile << name << "\n";
myfile << contact << "\n";
myfile << members << "\n";
myfile << prize << "\n";
myfile.close();
}
break;
case 3:
myfile.open(combine_name(members, name), ios::out);
if (myfile.is_open())
{
myfile << name << "\n";
myfile << contact << "\n";
myfile << members << "\n";
myfile << prize << "\n";
myfile.close();
}
break;
case 4:
myfile.open(combine_name(members, name), ios::out);
if (myfile.is_open())
{
myfile << name << "\n";
myfile << contact << "\n";
myfile << members << "\n";
myfile << prize << "\n";
myfile.close();
}
break;
case 5:
myfile.open(combine_name(members, name), ios::out);
if (myfile.is_open())
{
myfile << name << "\n";
myfile << contact << "\n";
myfile << members << "\n";
myfile << prize << "\n";
myfile.close();
}
break;
case 6:
myfile.open(combine_name(members, name), ios::out);
if (myfile.is_open())
{
myfile << name << "\n";
myfile << contact << "\n";
myfile << members << "\n";
myfile << prize << "\n";
myfile.close();
}
break;
case 7:
myfile.open(combine_name(members, name), ios::out);
if (myfile.is_open())
{
myfile << name << "\n";
myfile << contact << "\n";
myfile << members << "\n";
myfile << prize << "\n";
myfile.close();
}
break;
case 8:
myfile.open(combine_name(members, name), ios::out);
if (myfile.is_open())
{
myfile << name << "\n";
myfile << contact << "\n";
myfile << members << "\n";
myfile << prize << "\n";
myfile.close();
}
break;
case 9:
myfile.open(combine_name(members, name), ios::out);
if (myfile.is_open())
{
myfile << name << "\n";
myfile << contact << "\n";
myfile << members << "\n";
myfile << prize << "\n";
myfile.close();
}
break;
default:
cout << "Something went wrong. Try again.....";
owner();
break;
}
}
int main()
{
intro();
system("cls");
int I_am;
cout << "\n\tWho are you?\n\t\t1) I am a boarding owner\n\t\t2) I am a boarding finder\n\tSelect your answer (1,2): ";
cin >> I_am;
switch (I_am)
{
case 1:
owner();
cout << endl;
cout << name << " your data has been recorded..........." << endl;
break;
case 2:
finder();
break;
default:
break;
}
}