-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask5.cpp
268 lines (244 loc) · 8.36 KB
/
task5.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
#include <iostream>
#include <string>
using namespace std;
class booking
{
public:
void welcome();
void checkAvailableMovies();
void typeofmv();
void cost();
void inputSeats();
void location();
void showticket();
}; // end of class booking
int a;
int s, p, l, m, day;
int n;
string arrM[8] = {"Action Movie", "Romantic Movie ", "Inspirational movie", "Comedy movie", "Horror movie", "Animation movie",
"War movie ", "Mystery movie"};
string arrP[5] = {"Google pay", "Phonepe", "Paytm", "Card", "Cash"};
string arr2[4] = {"PRIME PLUS (Front) Seats", "PRIME Seats", "CLASSIC PLUS Seats", "CLASSIC (Last) seats"};
string arrDay[4] = {"Today", "Tomorrow", "Day After Tomorrow", "Later"};
string arrLoc[8] = {"INOX: AIPL Joy Street, Gurgaon", "PVR: Anupam Saket", "Miraj Cinemas: M4U, Sahibabad",
"MovieMax: Pacific Mall Ghaziabad", "PVR: Vegas Dwarka", "G3S Cinema: Rohini (Newly Renovated)", "Cinepolis: DLF Avenue, Saket",
"PVR: Anupam Saket, Delhi"};
string arrSeat[5]; // declared by user
void booking::welcome()
{
cout << "\n\n{ ~ ~ ~ WELCOME TO MOVIE TICKET BOOKING SYSTEM ~ ~ ~ }\n\n\n";
}
void booking::checkAvailableMovies()
{
cout << "Steps for booking a Movie Ticket :- \n\n";
cout << " 1.Trendy or latest Movies\n 2.Available Seats\n 3.Select day or date\n 4.Choose Location\n 5.Purchase Ticket\n 6.Show details of booking\n";
cout << "\nEnter Choice number : ";
// int n;
cin >> n;
cout << "\n\n";
}
void booking ::typeofmv()
{
cout << "What type of movie you prefer?" << endl;
// string arrM[8] = {"Action Movie","Romantic Movie ","Inspirational movie","Comedy movie","Horror movie","Animation movie",
//"War movie,"Mystery movie"};
for (int i = 0; i < 8; i++)
{
cout << i + 1 << "." << arrM[i] << endl;
}
cout << "\nPlease Enter the Choice Number : ";
// int a;
cin >> a;
cout << "\n\n";
switch (a)
{
case 1:
cout << "The Most Trendy Movies nowadays in your chosed type are : " << endl;
cout << "\n1.KGF \n2.Bang Bang \n3.Ra-One\n4.Blood Money\n";
cout << "\nEnter Choice number : ";
break;
case 2:
cout << "The Most Trendy Movies nowdays in your chosed type are : " << endl;
cout << "\n1.Luca \n2.Dora The explorer\n3.Mr.Bean's Holiday\n";
cout << "\nEnter Choice number : ";
break;
case 3:
cout << "The Most Trendy Movies nowdays in your chosen type are : " << endl;
cout << "\n1. \n2.\n3.\n";
break;
case 4:
cout << "The Most Trendy Movies nowdays in your chosen type are : " << endl;
cout << "\n1.Dream Girl 2 \n2.OMG 2\n3.Golmaal 5\n";
cout << "\nEnter Choice number : ";
int d;
cin >> d;
cout << "\nMovie selected : Dream Girl 2 \n\n\n";
break;
case 5:
cout << "The Most Trendy Movies nowadays in your chosen type are : " << endl;
cout << "\n1.The Nun 2 \n2.Bhoot\n3.\n";
break;
case 6:
cout << "The Most Trendy Movies nowadays in your chosen type are : " << endl;
cout << "\n1. \n2.\n3.\n";
break;
case 7:
cout << "The Most Trendy Movies nowadays in your chosen type are : " << endl;
cout << "\n1. \n2.\n3.\n";
break;
case 8:
cout << "The Most Trendy Movies nowadays are : " << endl;
cout << "\n1.Spy \n2.V1\n3.The Prestige\n";
cout << "\nEnter Choice number : ";
break;
default:
cout << "Please enter a valid number : ";
cin >> a;
break;
} // end of switch statement
}
void booking ::cost()
{
cout << "The Cost of your choosen Movie Ticket per seat is Rs 250.\nSo,your Total cost is : Rs " << s * 250 << "\n\n";
// Thanks! Hope to see you back soon :)
}
void booking ::inputSeats()
{
// string arr2[] = {"PRIME PLUS (Front) Seats", "PRIME Seats", "CLASSIC PLUS Seats", "CLASSIC (Last) seats"};
for (int i = 0; i < 4; i++)
{
cout << i + 1 << "." << arr2[i] << endl;
}
cout << "\nEnter Choice number : ";
// int m;
cin >> m;
cout << "\n";
cout << "What are the required no. of seats? : ";
// int s;
cin >> s;
cout << "\nAvailable seats are :-\n";
string arrS[13] = {"A3", "A4", "A5", "D9", "D10", "D11", "D12", "G5", "G6", "H4", "K1", "K2", "L9"};
for (int i = 0; i < 12; i++)
{
cout << i + 1 << "." << arrS[i] << endl;
}
cout << "Type the Seat names you want to Book : \n";
// string arrSeat[s];
for (int i = 0; i < s; i++)
{
cin >> arrSeat[i];
}
cout << "\n";
}
void booking ::location()
{
cout << "Which location do you prefer? : \n\n";
for (int i = 0; i < 8; i++)
{
cout << i + 1 << "." << arrLoc[i] << endl;
}
cout << "\nEnter Choice number : ";
// int l;
cin >> l;
cout << "\n";
// cout << "\nOkay! Now go for other details.\n\n";
cout << "Location selected : " << arrLoc[l - 1] << "\n\n\n";
}
void booking ::showticket()
{
cout << "Please Enter your Name : ";
string name;
cin >> name;
cout << "\nCongratulations! " << name << ", Your Movie ticket has been booked for " << arrDay[day - 1] << endl
<< endl;
cout << "Movie Ticket Information - \n\n";
cout << "Name :" << name;
cout << "\nLocation selected : " << arrLoc[l - 1] << endl;
cout << "Movie chosen : " << arrM[a] << "\n";
cout << "No. of seats booked : " << s;
cout << "\nSeats preferred : " << arr2[m - 1];
cout << "\nSeat numbers are : ";
for (int i = 0; i < s; i++)
{
cout << arrSeat[i] << " ";
}
cout << "\nPayment done through : " << arrP[p - 1] << endl;
cout << "INR per ticket : Rs 250" << endl;
cout << "Total Amount paid : Rs " << s * 250 << endl;
cout << "\nTHANKYOU , See you soon!\n\n";
}
int main()
{
// welcome page
booking obj1;
obj1.welcome();
do
{
// ask for type of movie veiwer prefer
obj1.checkAvailableMovies();
// int n;
switch (n)
{
case 1:
obj1.typeofmv();
// obj1.checkAvailableMovies();
break;
case 2:
cout << "What seats do you prefer? : \n\n";
obj1.inputSeats();
cout << "Seats selected : ";
for (int i = 0; i < s; i++)
{
cout << arrSeat[i] << " ";
}
cout << "\n\n\n";
// obj1.checkAvailableMovies();
// seatinfo();
break;
case 3:
{
cout << "Booking required for which day? : \n\n";
// string arrDay[4] = {"Today", "Tommorow", "Day After Tommorow", "Later"};
for (int i = 0; i < 4; i++)
{
cout << i + 1 << "." << arrDay[i] << endl;
}
// int day;
cout << "\n\nEnter Choice number : ";
cin >> day;
cout << "\n\n";
cout << "Day chosen for movie : " << arrDay[day - 1] << "\n\n\n";
// cout << "\nOkay! Now go for other details.\n\n";
// obj1.checkAvailableMovies();
break;
}
case 4:
obj1.location();
// obj1.checkAvailableMovies();
break;
case 5:
obj1.cost();
cout << "How would you like to pay?? : \n";
for (int i = 0; i < 5; i++)
{
cout << i + 1 << "." << arrP[i] << endl;
}
// int p;
cout << "\nEnter Choice number : ";
cin >> p;
cout << "\nYour Payment has been done through " << arrP[p - 1] << " successfully!\n\n\n";
// cout << "\nOkay! Now go for other details.\n\n";
// obj1.checkAvailableMovies();
break;
case 6:
// break;
// case 7:
cout << "Your booking has been done successfully!\n\n";
break;
default:
cout << "Please enter valid number.";
break;
}
} while (n != 6); // end of do while loop
obj1.showticket();
} // end of main.