-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDriverCode.cpp
1393 lines (1321 loc) · 35.5 KB
/
DriverCode.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
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// libraries included in the code
#include <iostream>
#include <stdio.h>
#include <cstdio>
#include <windows.h> //clean the terminal window
#include <conio.h> //to use automatic enter and sleep inbuit function
#include <string> //exit
#include <string.h>
#include <fstream>
#include <limits>
#include <stack> //to make cart system and to use in return dvd;
#include <algorithm>
// int MovieCost;
using namespace std;
// making a CART to store many DVD price at leave the at a simple
stack<int> cart;
// three prototyping
void Redirecting();
// two classes
class Customer;
// -have name
// -have age
// +type -> whether old or new
// +make payment
// +set name and age if user is new
// +signup -> creates 4 files || balance || name ||age || movie rented || overwrite user data
// +signin -> access database file and set private members
// +name && age -> return user name and age as on demand
class movie;
// an abstract class
// cart get filled in main function
// here cart prices sum gets evaluated
// defined above -> used in member function of class customer
int total()
{ // finding the total price items in the cart
// NOTE: this actually sums the price of buying cacets
int sum(0);
while (!cart.empty())
{
sum += cart.top();
cart.pop();
}
return sum;
}
class Customer
{
private:
int Age;
string NAME;
public:
int TypeOfUser; // user type is 0 if user is new else is 1
void SignUp(); // sets-up sign up process
void SignIn(string); // sets up sign in process
string name() { return NAME; } // if user is in need to have name
int age() { return Age; } // if user is in need to have age
void setter(string); // to set name and age
void MakePayment(); // payment
Customer(){};
};
void Customer::MakePayment()
{
// payment page to depict real world buying services
cout << "\nPRESS ENTER TO CONFIRM YOU ORDER";
fflush(stdin);
getchar();
Sleep(1000);
cout << "Redirecting you to our S.P.P.[Secure Payment Portal]" << endl;
Redirecting();
system("CLS");
// processing payment page
cout << "Processing your Payment..";
for (int i = 0; i < 3; i++)
{
cout << i + 1 << " ";
Sleep(2000);
}
cout << endl;
int price = 0;
price = total();
// ReWriting Payment in dummy payment file as to make
// some payments decline
ifstream abstracting_Balance;
abstracting_Balance.open("DATABASE\\DummyPaymentData\\" + NAME + "bal.txt");
int balance = 0;
abstracting_Balance >> balance;
abstracting_Balance.close();
if (price > balance)
{
cout << "OH NO!! ";
for (int i = 0; i < 3; i++)
{
cout << i + 1 << " ";
Sleep(1000);
}
cout << endl;
cout << "Transaction failed" << endl;
cout << "REASON: NOT ENOUGH BALANCE IN YOUR ACCOUNT" << endl;
}
else
{
ofstream writing_newbalance;
writing_newbalance.open("DATABASE\\DummyPaymentData\\" + NAME + "bal.txt");
int int_val = 0;
cout << endl
<< "Your order is successfully placed" << endl;
cout << "You can check a receipt that has been saved in your computer " << endl;
int_val = balance - price;
// pay.open("DATABASE\\DummyPaymentData\\"+NAME+"bal.txt",ios_base::out);
writing_newbalance << int_val;
cout << endl;
writing_newbalance.close();
ofstream writing_Receipt;
writing_Receipt.open("Receipt\\" + NAME + "_receipt.txt", ios_base::out);
writing_Receipt << "Thanks! for the purchase " << endl;
writing_Receipt << NAME << "! Hope you liked our service" << endl;
writing_Receipt << "You had successfully made a transaction " << endl
<< endl;
writing_Receipt << "AMOUNT PAID: " << price << endl;
writing_Receipt.close();
}
}
// constructor setting up the constraints of customer
void Customer::setter(string Name)
{
cout << "\n";
NAME = Name;
cout << "Enter your Age: ";
cin >> Age;
}
// sign in process
// if user exists this opens the text files of the user
void Customer::SignIn(string Name)
{
NAME = Name;
int extracted_age;
ifstream signin;
signin.open("users\\" + Name + "age.txt");
signin >> extracted_age;
Age = extracted_age;
}
// sign in process
void Customer::SignUp()
{
// animation of registering the userr
cout << "Registering User in our database ";
for (int i = 0; i < 3; i++)
{
cout << ". ";
Sleep(1000);
}
// creating the required files needed to wark;
cout << "User is successfully registered in our database" << endl;
Sleep(1000);
cout << "You can now proceeds further\n";
ofstream sufile;
sufile.open("users\\" + NAME + ".txt");
sufile << NAME;
sufile.close();
sufile.open("users\\" + NAME + "age.txt");
sufile << Age;
sufile.close();
sufile.open("users\\" + NAME + "MR.txt");
sufile.close();
sufile.open("DATABASE\\DummyPaymentData\\" + NAME + "bal.txt");
sufile << 3000;
sufile.close();
sufile.open("DATABASE\\User_Data\\userdatabase.txt", ios_base::app);
sufile << NAME << "\n";
sufile.close();
}
// class movie - abstract class
// pure virtual function - movie show function()=0;
// movie show function() - *READS THE SHOWCASE||GENERAL FILE* to print movie list
class movie
{
public:
virtual void MovieList() = 0;
virtual void SpecificMovie(int,int) = 0;
};
// hierarchical inheritance
// movie -> sub genre
std::fstream &GotoLine(std::fstream &file, unsigned int num)
{
file.seekg(std::ios::beg);
for (int i = 0; i < num - 1; ++i)
{
file.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
return file;
}
// encapsulation
class Action : public movie
{
public:
void MovieList()
{
// open showcase files
fstream in("DATABASE\\Movies\\Action.txt");
string Action;
while (getline(in, Action))
{
cout << Action << endl;
}
in.close();
}
void SpecificMovie(int MovieNumber,int indexing_element)
{
fstream file("DATABASE\\Movies\\Action.txt");
GotoLine(file, (MovieNumber - 1) * 8);
string print;
for (int i = 0; i < 5; i++)
{
getline(file, print);
if (i==0)
{
print[0]=indexing_element;
cout << print <<endl;
}
else
cout << print << endl;
}
cout << endl;
}
};
class Adventure : public movie
{
public:
void MovieList()
{
fstream in("DATABASE\\Movies\\Adventure.txt");
string Adventure;
while (getline(in, Adventure))
{
cout << Adventure << endl;
}
in.close();
}
void SpecificMovie(int MovieNumber,int indexing_element)
{
fstream file("DATABASE\\Movies\\Adventure.txt");
GotoLine(file, (MovieNumber - 1) * 8);
string print;
for (int i = 0; i < 5; i++)
{
getline(file,print);
if (i==0)
{
print[0]=indexing_element;
cout << print <<endl;
}
else
cout << print << endl;
}
cout << endl;
}
};
class Animation : public movie
{
public:
void MovieList()
{
fstream in("DATABASE\\Movies\\Animation.txt");
string Animation;
while (getline(in, Animation))
{
cout << Animation << endl;
}
in.close();
}
void SpecificMovie(int MovieNumber,int indexing_element)
{
fstream file("DATABASE\\Movies\\Animation.txt");
GotoLine(file, (MovieNumber - 1) * 8);
string print;
for (int i = 0; i < 5; i++)
{
getline(file, print);
if (i==0)
{
print[0]=indexing_element;
cout << print <<endl;
}
else
cout << print << endl;
}
cout << endl;
}
};
class Comedy : public movie
{
public:
void MovieList()
{
fstream in("DATABASE\\Movies\\Comedy.txt");
string Comedy;
while (getline(in, Comedy))
{
cout << Comedy << endl;
}
in.close();
}
void SpecificMovie(int MovieNumber,int indexing_element)
{
fstream file("DATABASE\\Movies\\Comedy.txt");
GotoLine(file, (MovieNumber - 1) * 8);
string print;
for (int i = 0; i < 5; i++)
{
getline(file, print);
if (i==0)
{
print[0]=indexing_element;
cout << print <<endl;
}
else
cout << print << endl;
}
cout << endl;
}
};
class Documentary : public movie
{
public:
void MovieList()
{
fstream in("DATABASE\\Movies\\Documentary.txt");
string Documentary;
while (getline(in, Documentary))
{
cout << Documentary << endl;
}
in.close();
}
void SpecificMovie(int MovieNumber,int indexing_element)
{
fstream file("DATABASE\\Movies\\Documentary.txt");
GotoLine(file, (MovieNumber - 1) * 8);
string print;
for (int i = 0; i < 5; i++)
{
getline(file, print);
if (i==0)
{
print[0]=indexing_element;
cout << print <<endl;
}
else
cout << print << endl;
}
cout << endl;
}
};
class Drama : public movie
{
public:
void MovieList()
{
fstream in("DATABASE\\Movies\\Drama.txt");
string Drama;
while (getline(in, Drama))
{
cout << Drama << endl;
}
in.close();
}
void SpecificMovie(int MovieNumber,int indexing_element)
{
fstream file("DATABASE\\Movies\\Drama.txt");
GotoLine(file, (MovieNumber - 1) * 8);
string print;
for (int i = 0; i < 5; i++)
{
getline(file, print);
if (i==0)
{
print[0]=indexing_element;
cout << print <<endl;
}
else
cout << print << endl;
}
cout << endl;
}
};
class Horror : public movie
{
public:
void MovieList()
{
fstream in("DATABASE\\Movies\\Horror.txt");
string Horror;
while (getline(in, Horror))
{
cout << Horror << endl;
}
in.close();
}
void SpecificMovie(int MovieNumber,int indexing_element)
{
fstream file("DATABASE\\Movies\\Horror.txt");
GotoLine(file, (MovieNumber - 1) * 8);
string print;
for (int i = 0; i < 5; i++)
{
getline(file, print);
if (i==0)
{
print[0]=indexing_element;
cout << print <<endl;
}
else
cout << print << endl;
}
cout << endl;
}
};
class Romantic : public movie
{
public:
void MovieList()
{
fstream in("DATABASE\\Movies\\Romantic.txt");
string Romantic;
while (getline(in, Romantic))
{
cout << Romantic << endl;
}
in.close();
}
void SpecificMovie(int MovieNumber,int indexing_element)
{
fstream file("DATABASE\\Movies\\Romantic.txt");
GotoLine(file, (MovieNumber - 1) * 8);
string print;
for (int i = 0; i < 5; i++)
{
getline(file, print);
if (i==0)
{
print[0]=indexing_element;
cout << print <<endl;
}
else
cout << print << endl;
}
cout << endl;
}
};
class ScienceFiction : public movie
{
public:
void MovieList()
{
ifstream in("DATABASE\\Movies\\Sciencefiction.txt");
string SciFi;
while (getline(in, SciFi))
{
cout << SciFi << endl;
}
in.close();
}
void SpecificMovie(int MovieNumber,int indexing_element)
{
fstream file("DATABASE\\Movies\\Sciencefiction.txt");
GotoLine(file, (MovieNumber - 1) * 8);
string print;
for (int i = 0; i < 5; i++)
{
getline(file, print);
if (i==0)
{
print[0]=indexing_element;
cout << print <<endl;
}
else
cout << print << endl;
}
cout << endl;
}
};
class Thriller : public movie
{
public:
void MovieList()
{
ifstream in("DATABASE\\Movies\\Thriller.txt");
string thriller;
while (getline(in, thriller))
{
cout << thriller << endl;
}
in.close();
}
void SpecificMovie(int MovieNumber,int indexing_element)
{
fstream file("DATABASE\\Movies\\Thriller.txt");
GotoLine(file, (MovieNumber - 1) * 8);
string print;
for (int i = 0; i < 5; i++)
{
getline(file, print);
if (i==0)
{
print[0]=indexing_element;
cout << print <<endl;
}
else
cout << print << endl;
}
cout << endl;
}
};
// objects of moive claSSES
Action AC;
Adventure AD;
Animation AN;
Comedy CO;
Documentary DO;
Drama DR;
Horror HO;
Romantic RO;
ScienceFiction SF;
Thriller TH;
// These two functions are clubed
// Text Animation of showing output
void ManageOutput_MCS()
{
cout << endl;
cout << "Thanks for choosing....." << endl;
Sleep(1000);
cout << "Searching up database....." << endl;
Sleep(1000);
cout << "Proceeding list in ";
for (int i = 0; i < 3; i++)
{
cout << i + 1 << " ";
Sleep(1000);
}
}
// condition to check a user can buy movies which could be inappropriate for some user
int Appropriate_Age_Finder(int x, Customer C)
{
int m = C.age();
if ((x == 8 || x == 7) && m < 18)
{
cout << "\nYou can not access this genre as you are underaged\n";
return 1;
}
else
{
return 0;
}
}
// movie choice selector
void MovieChoiceSelector(int &no, Customer C)
{
int x;
re_enter_choice:
start:
fflush(stdin);
cout << "\nSelect Genre:\n1:Action\t\t2:Adventure\n3:Animation\t\t4:Comedy\n5:Documentary\t\t6:Drama\n7:Horror\t\t8:Romantic\n9:Science Fiction\t10:Thriller\n\nEnter Your Choice: ";
cin >> x;
no = x;
while (Appropriate_Age_Finder(x, C))
{
goto re_enter_choice;
}
ManageOutput_MCS();
system("CLS");
switch (x)
{
case 1:
AC.MovieList();
break;
case 2:
AD.MovieList();
break;
case 3:
AN.MovieList();
break;
case 4:
CO.MovieList();
break;
case 5:
DO.MovieList();
break;
case 6:
DR.MovieList();
break;
case 7:
HO.MovieList();
break;
case 8:
RO.MovieList();
break;
case 9:
SF.MovieList();
break;
case 10:
TH.MovieList();
break;
default:
cout << "\nYou have entered Wrong Option\nPlease Enter Right option :(";
goto start;
break;
}
cout << endl;
}
// Redirecting ANIMATIONS
void Redirecting()
{
cout << "Re-directing you in ";
for (int i = 0; i < 3; i++)
{
// print number i.e 1 2 3
cout << i + 1 << " ";
// pause program for time effect
Sleep(1000);
}
cout << endl;
}
// used for internal working of system
// this actually give the slected movie a unique identification that
// will in future wiil be used to extract movie name
void GivingRightSequence(int &ms)
{
if (ms == 1)
{
ms = 0;
}
else if (ms == 2)
{
ms = 5;
}
else if (ms == 3)
{
ms = 10;
}
else if (ms == 4)
{
ms = 15;
}
else if (ms == 5)
{
ms = 20;
}
else if (ms == 6)
{
ms = 25;
}
else if (ms == 7)
{
ms = 30;
}
else if (ms == 8)
{
ms = 35;
}
else if (ms == 9)
{
ms = 40;
}
else if (ms == 10)
{
ms = 45;
}
}
// writes the movies rented code on the text file
void movie_on_rent(int movie_code, string name, int n)
{
if (n == 2)
{
fstream fout("users\\" + name + "MR.txt", ios_base::app);
fout << movie_code << "\n";
}
}
// sum up the stacck and find total price to be paid
// type referse as the what you what to do buy or rent
int movieCostfinder_fromfile(int type, int number)
{
if (type == 1)
{
ifstream price;
price.open("DATABASE\\workingFiles\\Buy_Rates.txt");
int paise;
for (int i = 1; i < number; i++)
{
price >> paise;
}
return paise;
price.close();
}
else if (type == 2)
{
ifstream price;
price.open("DATABASE\\workingFiles\\Rent_Rates.txt");
int paise;
for (int i = 1; i < number; i++)
{
price >> paise;
}
return paise;
price.close();
}
else
{
int a = 0;
return a;
}
}
// handlinng price deduction frmt dummy payment
void movie_return_recipt(string name, int rentbe_paid)
{
ifstream in;
in.open("DATABASE\\DummyPaymentData\\" + name + "bal.txt");
int last_amount;
in >> last_amount;
in.close();
ofstream out;
out.open("DATABASE\\DummyPaymentData\\" + name + "bal.txt");
out << last_amount - rentbe_paid;
out.close();
ofstream writing_Receipt;
writing_Receipt.open("Receipt\\" + name + "_receipt.txt", ios_base::out);
writing_Receipt << name << " Thanks! for clearing your dues" << endl;
writing_Receipt << "transaction made succesfully" << endl
<< endl;
writing_Receipt << "AMOUNT PAID: " << rentbe_paid << endl;
writing_Receipt.close();
}
// feature to return a book
void return_feature(string name, int &vapsi)
{
a1:
fflush(stdin);
int movie_number, eye = 0;
cout << "Enter Movie ID of movie you want to Return: ";
cin >> movie_number;
stack<int> User_rented_movie;
ifstream returnfetr;
returnfetr.open("users\\" + name + "MR.txt");
int movies, condition = 1;
while (returnfetr >> movies)
{
if (movie_number == movies)
{
condition = 0;
}
else
{
eye++;
User_rented_movie.push(movies);
}
}
returnfetr.close();
if (condition)
{
int dhikana;
cout << "You Doesn't have this movie" << endl;
a2:
cout << "1:Re-Enter movie number\n2:Rent or Buy More movie\n3:exit\nEnter your choice: ";
cin >> dhikana;
switch (dhikana)
{
case 1:
goto a1;
break;
case 2:
vapsi = 1;
return;
break;
case 3:
exit(0);
break;
default:
cout << "\nWrong Choice!! \n";
goto a2;
break;
}
}
ofstream x;
x.open("users\\" + name + "MR.txt");
for (int i = 0; i < eye; i++)
{
int last;
last = User_rented_movie.top();
x << last << "\n";
User_rented_movie.pop();
}
x.close();
cout << endl
<< "connecting to bank for clearing dues " << endl
<< "paying dues " << endl;
for (int i = 0; i < 4; i++)
{
cout << ". ";
Sleep(1000);
}
int rent_to_be_paid;
// there is a catvh that after entering
// movie number it shows the price of one less movie hence always use the function with +1
rent_to_be_paid = movieCostfinder_fromfile(2, movie_number + 1);
cout << rent_to_be_paid << endl;
movie_return_recipt(name, rent_to_be_paid);
cout << "Dues cleared" << endl;
if (!condition)
{
cout << "Thanks for Returning movie\n";
cout << "You are now no more subjected to Rents anymore\n";
reenter:
fflush(stdin);
cout << "Do you want to buy or rent more?\n1]YES\t\t2]NO\nEnter command as string: ";
string answer;
cin >> answer;
cout << endl;
if (answer == "YES")
{
vapsi = 1;
return;
}
else if (answer == "NO")
{
exit(0);
}
else
{
cout << "Wrong choice :(" << endl;
cout << "Re-enter your command\n";
goto reenter;
}
}
}
// a thing to be corrected we can just simply use the modulus to back trace the
// the name of movie
// could be improved once finding the number and genre
// we can remove switch case
// by overloading the abstract class
// function to decode movie genre
int genre_decoder(int value)
{
if (value>0&&value<10)
{
if (value > 5)
return 2;
else
return 1;
}
int Once_place = value%10;
int Tens_place = value/10;
switch (Tens_place)
{
case 1:
if (Once_place==0)
return 2;
else if(Once_place>5)
return 4;
else
return 3;
break;
case 2:
if (Once_place==0)
return 4;
else if(Once_place>5)
return 6;
else
return 5;
break;
case 3:
if (Once_place==0)
return 6;
else if(Once_place>5)
return 8;
else
return 7;
break;
case 4:
if (Once_place==0)
return 8;
else if(Once_place>5)
return 10;
else
return 9;
case 5:
if (Once_place==0)
return 10;
break;
}
}
// function to find movie number
int number_decoder(int value)
{
int Once_place = value%10;
int Tens_place = value/10;
if (value>0&&value<10)
{
if (value > 5)
return value-5;
else
return value;
}
else
{
if (Once_place == 0)
{
return 5;
}
else if (Once_place > 5)
{
return Once_place-5;
}
else
{
return Once_place;
}
}
}
void know_your_movie(string naame)
{
int value;
ifstream showRentMovie;
showRentMovie.open("users\\" + naame + "MR.txt");
int indexing = 0;
cout << endl;
cout << "Movie rented by you from us are:" << endl;
while (showRentMovie >> value)
{
indexing++;
int Decoded_genre = genre_decoder(value);
int Decoded_MovieSno = number_decoder(value);
switch (Decoded_genre)
{
case 1:
AC.SpecificMovie(Decoded_MovieSno,indexing);
break;
case 2:
AD.SpecificMovie(Decoded_MovieSno,indexing);
break;
case 3:
AN.SpecificMovie(Decoded_MovieSno,indexing);
break;
case 4:
CO.SpecificMovie(Decoded_MovieSno,indexing);
break;
case 5:
DO.SpecificMovie(Decoded_MovieSno,indexing);
break;
case 6:
DR.SpecificMovie(Decoded_MovieSno,indexing);
break;
case 7:
HO.SpecificMovie(Decoded_MovieSno,indexing);
break;
case 8:
RO.SpecificMovie(Decoded_MovieSno,indexing);
break;
case 9: