Need an advice for a program !

Hello guys !
So I made this program:
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
#include <iostream>
using namespace std;
enum BOOL { FALSE, TRUE };
typedef unsigned short int USHORT;
USHORT menu();
USHORT menu1();
USHORT menu2();
USHORT menu3();
USHORT menu4();
USHORT menu5();
string Name1,Name2,Name3,Name4,Name5,Name6,Name7,Name8,Name9,Name10,
Name11,Name12,Name13,Name14,Name15,Name16,Name17,Name18,Name19,Name20,
Name21,Name22,Name23,Name24,Name25,Name26,Name27,Name28,Name29,Name30;
void Hour1(),Hour2(),Hour3(),Hour4(),Hour5(),Hour6(),Hour7(),Hour8(),Hour9(),Hour10();
void Hr1(),Hr2(),Hr3(),Hr4(),Hr5(),Hr6(),Hr7(),Hr8(),Hr9(),Hr10();
void H1(),H2(),H3(),H4(),H5(),H6(),H7(),H8(),H9(),H10();
void Monday();
void Tuesday();
void Wednesday();
void Thursday();
void Friday();
int main()
{
BOOL exit = FALSE;
for (;;)
{
USHORT choice = menu();
switch(choice)
{
case (1):
Monday();
break;
case (2):
Tuesday();
break;
case (3):
Wednesday();
break;
case (4):
Thursday();
break;
case (5):
Friday();
break;
default:
cout << "''Look at the menu again!''\n\n\n";
continue;
}          // end switch

if (exit)
break;
}
return 0;
}

USHORT menu()
{
USHORT choice;

cout << " *** Day from the week ***\n\n";
cout << "(1) Monday\n";
cout << "(2) Tuesday\n";
cout << "(3) Wednesday\n";
cout << "(4) Thursday\n";
cout << "(5) Friday\n";
cout << "Please select a day: ";
cin >> choice;
return choice;
}


USHORT menu1()
{
USHORT choice;
cout << "\n *** Hour ***\n\n";
cout << "(1) 10:00-11:00"<<": "<<Name1<<" "<<Name2<<" "<<Name3<<" ";
cout << "(2) 11:00-12:00"<<": "<<Name4<<" "<<Name5<<" "<<Name6<<" ";
cout << "\n(3) 12:00-13:00"<<": "<<Name7<<" "<<Name8<<" "<<Name9<<" ";
cout << "(4) 13:00-14:00"<<": "<<Name10<<" "<<Name11<<" "<<Name12<<" ";
cout << "\n(5) 14:00-15:00"<<": "<<Name13<<" "<<Name14<<" "<<Name15<<" ";
cout << "(6) 15:00-16:00"<<": "<<Name16<<" "<<Name17<<" "<<Name18<<" ";
cout << "\n(7) 16:00-17:00"<<": "<<Name19<<" "<<Name20<<" "<<Name21<<" ";
cout << "(8) 17:00-18:00"<<": "<<Name22<<" "<<Name23<<" "<<Name24<<" ";
cout << "\n(9) 18:00-19:00"<<": "<<Name25<<" "<<Name26<<" "<<Name27<<" ";
cout << "(10) 19:00-20:00"<<": "<<Name28<<" "<<Name29<<" "<<Name30<<" ";
cout << "\nPlease select hour: ";
cin >> choice;
return choice;
}

USHORT menu2()
{
USHORT choice;

cout << "\n *** Hour ***\n\n";
cout << "(1) 10:00-11:00\n";
cout << "(2) 11:00-12:00\n";
cout << "(3) 12:00-13:00\n";
cout << "(4) 13:00-14:00\n";
cout << "(5) 14:00-15:00\n";
cout << "(6) 15:00-16:00\n";
cout << "(7) 16:00-17:00\n";
cout << "(8) 17:00-18:00\n";
cout << "(9) 18:00-19:00\n";
cout << "(10) 19:00-20:00\n";
cout << ": ";
cin >> choice;
return choice;
}

USHORT menu3()
{
USHORT choice;

cout << "\n *** Hour ***\n\n";
cout << "(1) 10:00-11:00\n";
cout << "(2) 11:00-12:00\n";
cout << "(3) 12:00-13:00\n";
cout << "(4) 13:00-14:00\n";
cout << "(5) 14:00-15:00\n";
cout << "(6) 15:00-16:00\n";
cout << "(7) 16:00-17:00\n";
cout << "(8) 17:00-18:00\n";
cout << "(9) 18:00-19:00\n";
cout << "(10) 19:00-20:00\n";
cout << ": ";
cin >> choice;
return choice;
}

void Monday()
{
BOOL exit = FALSE;
for (;;)
{
USHORT choice = menu1();
switch(choice)
{
case (1):
Hour1();
break ;
case (2):
Hour2();
break ;
case (3):
Hour3();
break ;
case (4):
Hour4();
break ;
case (5):
Hour5();
break ;
case (6):
Hour6();
break ;
case (7):
Hour7();
break ;
case (8):
Hour8();
break ;
case (9):
Hour9();
break ;
case (10):
Hour10();
break ;
default:
cout << "Look at the menu again!\n\n";
continue;
}

if (exit)
break;
}
}
void Tuesday()
{
BOOL exit = FALSE;
for (;;)
{
USHORT choice = menu2();
switch(choice)
{
case (1):
Hour1();
break ;
case (2):
Hour2();
break ;
case (3):
Hour3();
break ;
case (4):
Hour4();
break ;
case (5):
Hour5();
break ;
case (6):
Hour6();
break ;
case (7):
Hour7();
break ;
case (8):
Hour8();
break ;
case (9):
Hour9();
break ;
case (10):
Hour10();
break ;

default:
cout << "Look at the menu again!\n\n";
continue;
}

if (exit)
break;
}
}
void Wednesday()
{
BOOL exit = FALSE;
for (;;)
{
USHORT choice = menu3();
switch(choice)
{
case (1):
Hour1();
break ;
case (2):
Hour2();
break ;
case (3):
Hour3();
break ;
case (4):
Hour4();
break ;
case (5):
Hour5();
break ;
case (6):
Hour6();
break ;
case (7):
Hour7();
break ;
case (8):
Hour8();
break ;
case (9):
Hour9();
break ;
case (10):
Hour10();
break ;

default:
cout << "Look at the menu again!\n\n";
continue;
}

if (exit)
break;
}
}
void Thursday()
{
BOOL exit = FALSE;
for (;;)
{
USHORT choice = menu3();
switch(choice)
{
case (1):
Hour1();
break ;
case (2):
Hour2();
break ;
case (3):
Hour3();
break ;
case (4):
Hour4();
break ;
case (5):
Hour5();
break ;
case (6):
Hour6();
break ;
case (7):
Hour7();
break ;
case (8):
Hour8();
break ;
case (9):
Hour9();
break ;
case (10):
Hour10();
break ;

default:
cout << "Look at the menu again!\n\n";
continue;
}

if (exit)
break;
}
}
void Friday()
{
BOOL exit = FALSE;
for (;;)
{
USHORT choice = menu3();
switch(choice)
{
case (1):
Hour1();
break ;
case (2):
Hour2();
break ;
case (3):
Hour3();
break ;
case (4):
Hour4();
break ;
case (5):
Hour5();
break ;
case (6):
Hour6();
break ;
case (7):
Hour7();
break ;
case (8):
Hour8();
break ;
case (9):
Hour9();
break ;
case (10):
Hour10();
break ;

default:
cout << "Look at the menu again!\n\n";
continue;
}

if (exit)
break;
}
}
void Hour1()
{
cout << "\nPlease enter a name: ";
cin>>Name1;
cout<<menu1 ();
cout << "\nPlease enter a name: ";
cin>>Name2;
cout<< menu1 ();
cout << "\nPlease enter a name: ";
cin>>Name3;
cout<< menu1();
}
void Hour2()
{
cout << "\nPlease enter a name: ";
cin>>Name4;
cout<< menu1();
cout << "\nPlease enter a name: ";
cin>>Name5;
cout<< menu1();
cout << "\nPlease enter a name: ";
cin>>Name6;
cout<< menu1();
}
void Hour3()
{
cout << "\nPlease enter a name: ";
cin>>Name7;
cout<< menu1();
cout << "\nPlease enter a name: ";
cin>>Name8;
cout<< menu1();
cout << "\nPlease enter a name: ";
cin>>Name9;
cout<< menu1();
}
void Hour4()
{
cout << "\nPlease enter a name: ";
cin>>Name10;
cout<< menu1();
cout << "\nPlease enter a name: ";
cin>>Name11;
cout<< menu1();
cout << "\nPlease enter a name: ";
cin>>Name12;
cout<< menu1();
}
void Hour5()
{
cout << "\nPlease enter a name: ";
}
void Hour6()
{
cout << "\nPlease enter a name: ";
}
void Hour7()
{
cout << "\nPlease enter a name: ";
}
void Hour8()
{
cout << "\nPlease enter a name: ";
}
void Hour9()
{
cout << "\nPlease enter a name: ";
}
void Hour10()
{
cout << "\nPlease enter a name: ";
}

void Hr1()
{
cout << "\nPlease enter a name: ";
}

void Hr2()
{
cout << "\nPlease enter a name: ";
}
void Hr3()
{
cout << "\nPlease enter a name: ";
}
void Hr4()
{
cout << "\nPlease enter a name: ";
}
void Hr5()
{
cout << "\nPlease enter a name: ";
}
void Hr6()
{
cout << "\nPlease enter a name: ";
}
void Hr7()
{
cout << "\nPlease enter a name: ";
}
void Hr8()
{
cout << "\nPlease enter a name: ";
}
void Hr9()
{
cout << "\nPlease enter a name: ";
}
void Hr10()
{
cout << "\nPlease enter a name: ";
}
void H1()
{
cout << "\nPlease enter a name: ";
}

void H2()
{
cout << "\nPlease enter a name: ";
}
void H3()
{
cout << "\nPlease enter a name: ";
}
void H4()
{
cout << "\nPlease enter a name: ";
}
void H5()
{
cout << "\nPlease enter a name: ";
}
void H6()
{
cout << "\nPlease enter a name: ";
}
void H7()
{
cout << "\nPlease enter a name: ";
}
void H8()
{
cout << "\nPlease enter a name: ";
}
void H9()
{
cout << "\nPlease enter a name: ";
}
void H10()
{
cout << "\nPlease enter a name: ";
}


But when I choose for an example Monday then 10:00-11:00, enter a name and after that when I choose 11:00-12:00 and enter name again it shows the name after 10:00-11:00 instead after 11:00-12:00. Hope you can understand what I'm trying to say. If somebody can tell me where I'm doing it wrong it will be great.

There is so much wrong with your code, where do I start ? :)

Please explain to me what the objective of your code is.

Topic archived. No new replies allowed.