-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMTB.cpp
928 lines (817 loc) · 25.3 KB
/
MTB.cpp
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
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
#include <iostream>
#include <iomanip> //use to manipulate output
#include <fstream>
#include <string>
#include <math.h>
using namespace std;
class Movie
{
private:
string movieCode;
string movieName;
string movieGenre;
int movieYear;
string movieRating;
double moviePrice;
public:
int y, x, seat_icon3 = 254;
char seat[4][15];
int total_seat_select = 0;
int total_to_pay;
void welcome();
void login_menu();
void login();
void mainMenu();
void edit();
void add();
void view();
void rem();
void book();
void seat_display(int &y, int &x, char seat[4][15]);
void seat_select(int &y, int &x, char seat[4][15]);
void seat_select_agn(int &y, int &x, char seat[4][15]);
void check_class(int &y, int &x, char seat[4][15]);
void ticket_calculation(string movCode, int &total_seat_select);
void ticket_print(string movCode, char seat[4][15], int &total_seat_select);
void finish_seat(int &y, int &x, char seat[4][15]);
void sale_report(string movCode, int &y, int &x, char seat[4][15]);
};
void Movie::welcome()
{
for (int w = 1; w <= 76; w++)
{
cout << (char)205;
}
std::cout << R"(
# #
## ## # ##### ## #
# # # # # # # # # #
# # # # # # # # #
# # # ##### ###### #
# # # # # # # # #
# # # # # # # ####
#####
# # # # # ###### # # ## ####
# # ## # # ## ## # # #
# # # # # ##### # ## # # # ####
# # # # # # # # ###### #
# # # # ## # # # # # # #
##### # # # ###### # # # # ####
)"
<< "\n";
for (int w = 1; w <= 76; w++)
{
cout << (char)205;
}
cout << "\n\n\n";
system("pause");
}
void Movie::login_menu()
{
loop:
system("cls");
std::cout << R"(
================================
WELCOME TO MIRAJ CINEMAS
================================
********* LOGIN MENU *********
______________________________
| |
|____ 1) Login ________________|
| |
|____ 2) Exit _________________|
| |
|______________________________|
)";
int choice;
cout << "\n\n\t\t\t Your choice: ";
cin >> choice;
switch (choice)
{
case 1:
login();
break;
case 2:
exit(0);
default:
cout << "\n\n\t\t\tWrong Choice! Try Again.\n\n\n";
system("pause");
cin.clear();
fflush(stdin);
break;
}
goto loop;
}
void Movie::mainMenu()
{
system("cls");
std::cout << R"(
********** MAIN MENU **********
_______________________________
| |
|____ 1) Edit Movies List ______|
| |
|____ 2) Book Tickets __________|
| |
|____ 3) Exit __________________|
| |
|_______________________________|
)";
int choice;
cout << "\n\n\t\t\t Your choice: ";
cin >> choice;
switch (choice)
{
case 1:
edit();
break;
case 2:
{
book();
break;
}
case 3:
login_menu();
default:
cout << "\n\n\t\t\tWrong Choice! Try Again.\n\n\n";
system("pause");
cin.clear();
fflush(stdin);
mainMenu();
break;
}
}
void Movie::edit()
{
loop:
system("cls");
std::cout << R"(
*** EDIT MOVIES LIST ***
_______________________
| |
|____ 1) Add ___________|
| |
|____ 2) View __________|
| |
|____ 3) Remove ________|
| |
|____ 4) Main Menu _____|
| |
|_______________________|
)";
int choice;
cout << "\n\n\t\t\t Select any option: ";
cin >> choice;
switch (choice)
{
case 1:
add();
break;
case 2:
view();
cout << "\n\n";
system("pause");
break;
case 3:
rem();
break;
case 4:
mainMenu();
break;
default:
cout << "\n\n\t\t\tWrong Choice! Try Again.\n\n\n";
system("pause");
cin.clear();
fflush(stdin);
break;
}
goto loop;
}
void Movie::add()
{
char choice;
do
{
loop:
system("cls");
cout << "\n\t\t *** Add Movie Details ***\n";
fstream data;
data.open("movieDatabase.txt", ios::in);
int token = 0;
if (!data)
{
data.open("movieDatabase.txt", ios::app | ios::out);
cout << "\n\t\t Enter Movie Code: ";
cin >> movieCode;
fflush(stdin);
cout << "\n\t\t Enter Movie Name: ";
getline(cin, movieName);
cout << "\n\t\t Enter Movie Genre: ";
cin >> movieGenre;
cout << "\n\t\t Enter Movie Year: ";
cin >> movieYear;
cout << "\n\t\t Enter Movie Rating: ";
cin >> movieRating;
fflush(stdin);
cout << "\n\t\t Enter Movie Price: ";
cin >> moviePrice;
data << movieCode << "," << movieName << "," << movieGenre << "," << movieYear << "," << movieRating << "," << moviePrice << "\n";
data.close();
}
else
{
cout << "\n\t\t Enter Movie Code: ";
cin >> movieCode;
string line;
while (getline(data, line))
{
stringstream ss(line);
string record;
while (getline(ss, record, ','))
{
if (record == movieCode)
{
cout << "\n\t\t Duplicate Entry!! Please Try Again.\n\n";
system("pause");
token++;
}
}
}
data.close();
if (token == 1)
{
goto loop;
}
else
{
data.open("movieDatabase.txt", ios::app | ios::out);
fflush(stdin);
cout << "\n\t\t Enter Movie Name: ";
getline(cin, movieName);
cout << "\n\t\t Enter Movie Genre: ";
cin >> movieGenre;
cout << "\n\t\t Enter Movie Year: ";
cin >> movieYear;
cout << "\n\t\t Enter Movie Rating: ";
cin >> movieRating;
fflush(stdin);
cout << "\n\t\t Enter Movie Price: ";
cin >> moviePrice;
data << movieCode << "," << movieName << "," << movieGenre << "," << movieYear << "," << movieRating << "," << moviePrice << "\n";
data.close();
}
}
cout << "\n\t\t " << char(16) << " Movie Details Added!!";
cout << "\n\nDo you want to add another?\n";
cout << "[Y] YES\n[N] NO\n";
cin >> choice;
choice = toupper(choice);
} while (choice == 'Y' || choice != 'N');
}
void Movie::view()
{
system("cls");
for (int w = 1; w <= 107; w++)
{
cout << (char)205;
}
cout << "\n";
cout << setw(6) << left << "Code" << setw(47) << "Name" << setw(30) << "Genre" << setw(9) << "Year" << setw(9) << "Rating" << setw(8) << "Price"
<< "\n";
for (int w = 1; w <= 107; w++)
{
cout << (char)205;
}
cout << "\n";
ifstream myFileStream("movieDatabase.txt");
if (!myFileStream.is_open())
{
cout << "File failed to open" << endl;
}
string movCode, movName, movGenre, movRating;
int movYear;
double movPrice;
string myString, price;
string line;
while (getline(myFileStream, line))
{
stringstream ss(line);
getline(ss, movCode, ',');
getline(ss, movName, ',');
getline(ss, movGenre, ',');
getline(ss, myString, ',');
movYear = stoi(myString);
getline(ss, movRating, ',');
getline(ss, price, ',');
movPrice = stod(price);
cout << setw(6) << left << movCode << setw(47) << movName << setw(30) << movGenre << setw(9) << movYear << setw(9) << movRating << setw(8) << movPrice << "\n";
}
myFileStream.close();
}
void Movie::rem()
{
system("cls");
view();
cout << "\n\nEnter Movie Code: ";
cin >> movieCode;
string line;
ifstream ini_file{"movieDatabase.txt"};
ofstream out_file{"movieDatabaseNew.txt"};
if (ini_file && out_file)
{
while (getline(ini_file, line))
{
stringstream ss(line);
string record;
while (getline(ss, record, ','))
{
if (record == movieCode)
{
getline(ini_file, line);
}
continue;
}
out_file << line << "\n";
}
cout << "\n"
<< (char)16 << " Removed Successfully \n\n";
system("pause");
}
else
{
cout << "Cannot read File";
}
ini_file.close();
out_file.close();
remove("movieDatabase.txt");
rename("movieDatabaseNew.txt", "movieDatabase.txt");
ifstream in("movieDatabase.txt", ios::in);
ofstream out("movieDatabaseNew.txt", ios::out);
string readin;
while (!in.eof())
{
getline(in, readin);
if (readin != "")
{
out << readin << endl;
}
}
in.close();
out.close();
remove("movieDatabase.txt");
rename("movieDatabaseNew.txt", "movieDatabase.txt");
}
void Movie::book()
{
system("cls");
view();
cout << "\n\nEnter Movie Code: ";
cin >> movieCode;
for (y = 0; y < 4; y++)
for (x = 0; x < 15; x++)
seat[y][x] = seat_icon3;
string movCode, movName, movGenre, movRating;
int movYear;
double movPrice;
string myString, price;
string line;
fstream data;
data.open("movieDatabase.txt", ios::in);
if (!data)
{
cout << "\n\n Empty database";
}
else
{
string line;
while (getline(data, line))
{
stringstream ss(line);
string record;
while (getline(ss, record, ','))
{
if (record == movieCode)
{
stringstream ss(line);
getline(ss, movCode, ',');
getline(ss, movName, ',');
getline(ss, movGenre, ',');
getline(ss, myString, ',');
movYear = stoi(myString);
getline(ss, movRating, ',');
getline(ss, price, ',');
movPrice = stod(price);
data.close();
char choice;
loop:
do
{
system("cls");
seat_select_agn(y, x, seat);
check_class(y, x, seat);
ticket_calculation(movCode, total_seat_select);
ticket_print(movCode, seat, total_seat_select);
finish_seat(y, x, seat);
cout << "\nNext customer?\n[Y] YES\n[N] NO\n";
cin >> choice;
choice = toupper(choice);
if (choice == 'Y')
{
goto loop;
}
else
{
sale_report(movCode, y, x, seat);
mainMenu();
}
} while (choice == 'Y' || choice != 'N');
}
}
}
}
cout << "\nWrong Code!!\n\n";
system("pause");
mainMenu();
}
void Movie::seat_display(int &y, int &x, char seat[4][15])
{
cout << " ";
for (int screen = 0; screen <= 25; screen++)
{
cout << (char)254;
}
cout << " SCREEN ";
for (int screen = 0; screen <= 24; screen++)
{
cout << (char)254;
}
cout << endl;
for (int y = 0; y < 4; y++)
{
cout << y << " " << (char)179 << " " << seat[y][0] << " " << (char)179 << " " << seat[y][1] << " " << (char)179 << " " << seat[y][2] << " " << (char)179 << " " << seat[y][3] << " " << (char)179 << " " << seat[y][4] << " " << (char)179 << " " << seat[y][5] << " " << (char)179 << " " << seat[y][6] << " " << (char)179 << " " << seat[y][7] << " " << (char)179 << " " << seat[y][8] << " " << (char)179 << " " << seat[y][9] << " " << (char)179 << " " << seat[y][10] << " " << (char)179 << " " << seat[y][11] << " " << (char)179 << " " << seat[y][12] << " " << (char)179 << " " << seat[y][13] << " " << (char)179 << " " << seat[y][14] << " " << (char)179 << " " << endl;
}
cout << " ";
for (int z = 0; z < 10; z++)
{
cout << fixed << setw(4) << right << z;
}
cout << " ";
for (int z = 10; z < 15; z++)
{
cout << fixed << setw(4) << z;
}
cout << endl;
cout << " ";
for (int w = 1; w <= 59; w++)
{
cout << (char)205;
}
cout << endl
<< endl;
}
void Movie::seat_select(int &y, int &x, char seat[4][15])
{
cout << "Select seat (ROW > COLUMN)\n* Example : 0 , 9 * \n";
cout << "ROW : ";
cin >> y;
while (cin.fail())
{
cin.clear();
cin.ignore(132, '\n');
cout << "Please only enter NUMBER!\n";
cout << "ROW : ";
cin >> y;
}
while (y < 0 || y > 3)
{
cout << "Invalid input! Please enter a number of your seat.\n";
cout << "ROW : ";
cin >> y;
}
cout << "COLUMN : ";
cin >> x;
while (cin.fail())
{
cin.clear();
cin.ignore(132, '\n');
cout << "Please only enter NUMBER!\n";
cout << "COLUMN : ";
cin >> x;
}
while (x < 0 || x > 14)
{
cout << "Invalid input! Please enter a number of your seat.\n";
cout << "COLUMN : ";
cin >> x;
}
if (seat[y][x] != '1' && seat[y][x] != 'X')
{
seat[y][x] = '1';
}
else
{
cout << "Seat taken\n";
cout << endl;
}
seat_display(y, x, seat);
}
void Movie::seat_select_agn(int &y, int &x, char seat[4][15])
{
char seat_agn;
do
{
seat_display(y, x, seat);
cout << " \"1\" = Selected Seat\n \"X\" = Seat Sold / Seat Unavaible Currently\n ";
for (int screen = 0; screen <= 45; screen++)
{
cout << (char)196;
}
cout << endl;
seat_select(y, x, seat);
cout << "Do you want to select another seat again?\n";
cout << "[Y] YES\n[N] NO\n";
cin >> seat_agn;
seat_agn = toupper(seat_agn);
if (seat_agn == 'Y')
{
system("cls");
seat_select_agn(y, x, seat);
}
if (seat_agn != 'Y' && seat_agn != 'N')
{
cout << "Invalid! \nPlease keyin a correct Alphabet!\n";
}
} while (seat_agn != 'Y' && seat_agn != 'N');
}
void Movie::check_class(int &y, int &x, char seat[4][15])
{
system("cls");
for (y = 0; y < 4; y++)
{
for (x = 0; x <= 14; x++)
{
if (seat[y][x] == '1' && seat[y][x] != 'X')
{
++total_seat_select;
}
}
}
if (total_seat_select == 1)
{
cout << "\nYou have selected " << total_seat_select << " seat.\n\n";
}
else if (total_seat_select == 0)
{
cout << "\nYou have selected " << total_seat_select << " seat.\n\n";
}
else
{
cout << "\nYou have selected " << total_seat_select << " seats.\n\n";
}
}
void Movie::ticket_calculation(string movCode, int &total_seat_select)
{
fstream data;
data.open("movieDatabase.txt", ios::in);
string movName, movGenre, movRating;
int movYear;
double movPrice;
string myString, price;
string line;
while (getline(data, line))
{
stringstream ss(line);
string record;
while (getline(ss, record, ','))
{
if (record == movieCode)
{
stringstream ss(line);
getline(ss, movCode, ',');
getline(ss, movName, ',');
getline(ss, movGenre, ',');
getline(ss, myString, ',');
movYear = stoi(myString);
getline(ss, movRating, ',');
getline(ss, price, ',');
movPrice = stod(price);
}
}
}
data.close();
double cash_payment, change_due;
do
{
cout << "\n\t *** BILL CALCULATION ***\n\n";
//------calculation of total payment
total_to_pay = total_seat_select * movPrice;
cout << fixed << setw(20) << "Total to Pay = " << fixed << setw(19) << "Rs. " << fixed << setprecision(2) << (double)total_to_pay;
cout << endl;
//------user input the cash amount
cout << fixed << setw(20) << "Cash Payment : " << fixed << setw(19) << "Rs. ";
cin >> cash_payment;
if (cash_payment < total_to_pay)
{
cout << "Your amount is not valid! Please enter a correct amount.\n";
system("pause");
cout << "\033[2J\033[1;1H";
}
} while (cash_payment < total_to_pay);
//------calculation of change due
change_due = (double)cash_payment - total_to_pay;
cout << fixed << setw(20) << "Change Due = " << fixed << setw(19) << "Rs. " << fixed << setprecision(2) << (double)change_due;
cout << endl
<< endl;
system("pause");
}
void Movie::ticket_print(string movCode, char seat[4][15], int &total_seat_select)
{
fstream data;
data.open("movieDatabase.txt", ios::in);
string movName, movGenre, movRating;
int movYear;
double movPrice;
string myString, price;
string line;
while (getline(data, line))
{
stringstream ss(line);
string record;
while (getline(ss, record, ','))
{
if (record == movieCode)
{
stringstream ss(line);
getline(ss, movCode, ',');
getline(ss, movName, ',');
getline(ss, movGenre, ',');
getline(ss, myString, ',');
movYear = stoi(myString);
getline(ss, movRating, ',');
getline(ss, price, ',');
movPrice = stod(price);
}
}
}
data.close();
//---------------------------------- print ticket ----------------------------------//
system("cls");
for (int t = 1; t <= total_seat_select; t++)
{
for (int m = 0; m <= 65; m++)
{
cout << "=";
}
cout << "\n MIRAJ CINEMAS";
for (int s = 0; s <= 30; s++)
{
cout << " ";
}
cout << endl
<< endl;
cout << " Movie" << fixed << setw(10) << " = " << fixed << setw(5);
cout << movName << "\n";
cout << " Date / Time " << fixed << setw(3) << " = " << fixed << setw(5) << "11 - 11 - 2022 ( 11.00 am )";
cout << "\n Seat No: \n";
cout << " ";
for (int screen = 0; screen <= 25; screen++)
{
cout << (char)254;
}
cout << " SCREEN ";
for (int screen = 0; screen <= 24; screen++)
{
cout << (char)254;
}
cout << endl;
for (int y = 0; y < 4; y++)
{
cout << y << " " << (char)179 << " " << seat[y][0] << " " << (char)179 << " " << seat[y][1] << " " << (char)179 << " " << seat[y][2] << " " << (char)179 << " " << seat[y][3] << " " << (char)179 << " " << seat[y][4] << " " << (char)179 << " " << seat[y][5] << " " << (char)179 << " " << seat[y][6] << " " << (char)179 << " " << seat[y][7] << " " << (char)179 << " " << seat[y][8] << " " << (char)179 << " " << seat[y][9] << " " << (char)179 << " " << seat[y][10] << " " << (char)179 << " " << seat[y][11] << " " << (char)179 << " " << seat[y][12] << " " << (char)179 << " " << seat[y][13] << " " << (char)179 << " " << seat[y][14] << " " << (char)179 << " " << endl;
}
cout << " ";
for (int z = 0; z < 10; z++)
{
cout << fixed << setw(4) << z;
}
cout << " ";
for (int z = 10; z < 15; z++)
{
cout << fixed << setw(4) << z;
}
cout << endl;
cout << " ";
for (int w = 1; w <= 59; w++)
{
cout << (char)205;
}
cout << endl;
cout << setw(35) << right << fixed << setprecision(2) << "Price: Rs." << total_to_pay;
cout << endl;
for (int m = 0; m <= 65; m++)
{
cout << "=";
}
cout << endl;
}
cout << "\n\n";
system("pause");
}
void Movie::finish_seat(int &y, int &x, char seat[4][15])
{
if (total_seat_select != 0)
{
for (y = 0; y < 4; y++)
{
for (x = 0; x <= 14; x++)
{
if (seat[y][x] == '1' && seat[y][x] != 'X')
{
seat[y][x] = 'X';
}
}
}
}
total_seat_select = 0;
}
void Movie:: sale_report(string movCode, int &y, int &x, char seat[4][15])
{
int total_seat=0;
int empty_seat=0;
int total_seat_sold = 0;
system("cls");
for (y = 0; y < 4; y++)
{
for (x = 0; x <= 14; x++)
{
++total_seat;
if (seat[y][x] == 'X')
{
++total_seat_sold;
}
else if(seat[y][x] != 'X')
{
++empty_seat;
}
}
}
fstream data;
data.open("movieDatabase.txt", ios::in);
string movName, movGenre, movRating;
int movYear;
double movPrice;
string myString, price;
string line;
while (getline(data, line))
{
stringstream ss(line);
string record;
while (getline(ss, record, ','))
{
if (record == movieCode)
{
stringstream ss(line);
getline(ss, movCode, ',');
getline(ss, movName, ',');
getline(ss, movGenre, ',');
getline(ss, myString, ',');
movYear = stoi(myString);
getline(ss, movRating, ',');
getline(ss, price, ',');
movPrice = stod(price);
}
}
}
data.close();
cout << "\n\t\t\t *** SALES REPORT *** " << endl << endl;
cout << "\t\t Movie Name : " << movName << endl;
cout << "\t\t Total Seats : " << total_seat << endl;
cout << "\t\t Sold Seats : " << total_seat_sold << endl;
cout << "\t\t Empty Seats : " << empty_seat << endl;
cout << "\t\t Ticket Price : " << movPrice << endl;
cout << "\t\tTotal Amount Earned : " << total_seat_sold * movPrice << endl;
cout << "\n\n";
system("pause");
}
void Movie:: login()
{
string pass, password = "urssanjaysingh";
cout << "\n\n\t\t\tEnter the password to login: ";
cin >> pass;
if (pass == password)
{
Movie m;
m.mainMenu();
}
else
{
printf("\n\n\t\t\tWrong password!!\n\n\n");
system("pause");
}
}
int main()
{
Movie m;
m.welcome();
m.login_menu();
return 0;
}