Professional Documents
Culture Documents
On
B.C.A DEGREE
B.
INTERNATIONAL INSTITUTE OF MANAGEMENT
MEDIA & I.T
( 2023)
Final Year Students
BACHELOR OF COMPUTER
APPLICATION
PROGRAM (BCA)
INTERNATIONAL INSTITUTE OF
MANAGEMENT MEDIA & I.T. (IIMMI)
Name of Student : IZHAN PARVEZ
Course : B.C.A
DECLARATION
I hereby declare that the project work entitled
“…Railway Reservation
System………………………………………”submitted for the
Computer Application.
The matter embodied in this report has not submitted anywhere else
SUPERVISOR’S PROFILE
1. Name :
2. Designation :
3. Qualification : :
4. Area of Specialization : :
5. Experience : :
6. Office Name &Address : :
7. Contact No. :
8. E_Mail :
I am willing to supervise
Date:
Signature of Guide
CERTIFICATE OF THE GUIDE
Designation:
Working Place:
/ Ms. <student’s Name> under my supervision and guidance, for the fulfillment of Bachelors of
Computer Application.
Date:
Signature of Guide
ACKNOWLEDGMENT
IZHAN PARVEZ
Railway Reservation System Project in C++
In this tutorial, we’ll code the Railway Reservation
System Project in C++ in a very easy and understandable
way. The Railway Reservation System can be coded using
many programming languages, But in this project, we are
going to use C++ language as per the demand of
students.
Table of Contents
What is Railway Reservation System?
(https://learnprogramo.com/railway-reservation-system-
project-in-c-download-with-source-
code/#What_is_Railway_Reservation_System)
Features of Railway Reservation System Project in C++
(https://learnprogramo.com/railway-reservation-system-
project-in-c-download-with-source-
code/#Features_of_Railway_Reservation_System_Projec
t_in_C)
Modules of Railway Reservation System
(https://learnprogramo.com/railway-reservation-system-
project-in-c-download-with-source-
code/#Modules_of_Railway_Reservation_System)
Working of Project (https://learnprogramo.com/railway-
reservation-system-project-in-c-download-with-source-
code/#Working_of_Project)
Main Screen: (https://learnprogramo.com/railway-
reservation-system-project-in-c-download-with-source-
code/#Main_Screen)
View Information: (https://learnprogramo.com/railway-
reservation-system-project-in-c-download-with-source-
code/#View_Information)
Book Ticket: (https://learnprogramo.com/railway-
reservation-system-project-in-c-download-with-source-
code/#Book_Ticket)
Cancel Ticket: (https://learnprogramo.com/railway-
reservation-system-project-in-c-download-with-source-
code/#Cancel_Ticket)
Admin: (https://learnprogramo.com/railway-reservation-
system-project-in-c-download-with-source-
code/#Admin)
Exit: (https://learnprogramo.com/railway-reservation-
system-project-in-c-download-with-source-code/#Exit)
Download the Project
(https://learnprogramo.com/railway-reservation-system-
project-in-c-download-with-source-
code/#Download_the_Project)
Source Code of Railway Reservation System Project in
C++ (https://learnprogramo.com/railway-reservation-
system-project-in-c-download-with-source-
code/#Source_Code_of_Railway_Reservation_System_Pr
oject_in_C)
Steps to Run the Project
(https://learnprogramo.com/railway-reservation-system-
project-in-c-download-with-source-
code/#Steps_to_Run_the_Project)
Summary: (https://learnprogramo.com/railway-
reservation-system-project-in-c-download-with-source-
code/#Summary)
What is Railway Reservation System?
As the name suggests Railway Reservation System is
software that handles the entire booking data of the
Railway. It is fully based on the concept of reserving train
tickets for various destinations. Previously the task of
handling the tickets at a time was very difficult, so there
was a need for software that can handle all Railway
Reservation System.
Therefore the Railway Reservation System was designed.
After the release of this system, the stress and workload of
the employee were absolutely finished. It was also time-wasting for the travelers
to book a Ticket previously. But now it hardly takes 10 to 15 minutes to book a
ticket (https://www.makemytrip.com/railways/) wherever the passenger is.
Features of Railway Reservation System Project in C++
We have created separate logins for the passengers as well as admin, in which the
admin login is password protected.
In this project, the admin can add, update, delete and create the trains.
The passenger can book the train only if the train is added by the admin.
Passengers are able to see the actual data of available trains so that they can
choose which they want.
The entire rights are given to the admin adding, modifying and deleting the train.
This project use concept of file handling to store the booking data.
Cancelling the ticket is an main feature of this project.
Admin is able to change the password of login.
Modules of Railway Reservation System
Add Train
Modify Train
Delete Train
Search Train
Book Train
Cancel Booking
Working of Project
In the zip file, you’ll get an executable .exe file where you can
directly run the entire project manually. Now we’ll see the
working of the entire application with an explanation.
Main Screen:
When you run the project from any compiler or directly clicking
on the executable .exe file you’ll see the following screen
shown in the picture.
The above screen contains all the details of trains. If you want
to return to the main menu then press 1 or press any key to
exit the application.
Book Ticket:
In this section, passengers will be able to book the tickets.
When the Passenger chooses option 2 then the following
screen will appear.
We’ve displayed the menu of View information, Book the ticket, Cancel ticket,
Admin, and Exit. If you want to see the details of all available trains then your
choice will be 1. Similarly 2 for booking the ticket, 3 for cancellation of ticket. If
you are an admin you should give choice as 4.
Play
Unmute
Loaded: 7.95%
Remaining Time -7:31
Auto(360pLQ)
Fullscreen
Train Reservation Project in Java using JSP, Servlet and MYSQL
(https://humix.com/redirect?url=https%3A%2F%2Fcodebun.com%2Fhumix%2Fvi
deo%2F10c3e8519aa74c9f6617fecbe0eeeb5227ba903df21b5ab0bd6132a8bf74d
7c3)
Now we’ll see each and every menu in detail.
View Information:
In this option, the user will be able to see all the details of the available trains. The
details of all the trains will be displayed here which are stored in the file name
“train_details”. Only the admin can add the train details, no one other than the
admin can do operations on train details.
The passengers did not require additional sign-in to book the train. He or she’ll be
able to book the train directly.
When the user chooses the option as 1 then the following screen will appear:
The above screen contains all the details of trains. If you want to return to the
main menu then press 1 or press any key to exit the application.
Book Ticket:
In this section, passengers will be able to book the tickets. When the Passenger
chooses option 2 then the following screen will appear.
After entering the choice as 2, the software will ask the passenger to enter the
following information:
No of tickets which passenger wants to book.
Train number.
Date on which passenger want to travel.
Name of the passengers.
Contact Number of each passenger.
The software will ask for the above details for each and every passenger. Suppose
passengers enter no of tickets as 2 then the software’ll ask for the above details
of two passengers. After entering the details, the software will automatically
allocate the seat number to the passenger.
Cancel Ticket:
If the passenger’s mind changed and he wants to cancel the ticket urgently then
the software also has the facility of canceling the ticket on the spot. To cancel the
ticket, the passenger should choose option 3.
After choosing option 3, the following screen will appear:
void dlttrain();
20
void awrite();
21
void aread();
22
void bookticket_write();
23
void viewpassengers_read();
24
//-----------------------------------------user define function close-----------------
------------------
25
//-----------------------------------------structure start--------------------------------
--------------
26
struct adddata
27
{
28
char si[10];
29
char train_number[10];
30
char train_name[20];
31
char start[10];
32
char destination[10];
33
char price[10];
34
int seat;
35
char time[10];
36
} add[1000];
37
struct bookticket
38
{
39
char train_number[20];
40
char name[20];
41
char phone[20];
42
char date[20];
43
int seat;
44
}book[1000];
45
//---------------------------------------structure close----------------------------------
------------
46
//---------------------------------------global variable----------------------------------
------------
47
int k=0,u=0;
48
char trn_nmbr[100],name[100],phn[100];
49
//---------------------------------------main function start----------------------------
--------------
50
int main()
51
{
52
aread();
53
viewpassengers_read();
54
system("COLOR 0f");
55
int ch;
56
time_t currentTime;
57
time(¤tTime);
58
printf("\n\t\t\t %s\n",ctime(¤tTime));
59
60
printf("\n\t\t\t*********\n");
61
printf("\t\t\t*RAILWAY RESERVATION SYSTEM*\n");
62
printf("\t\t\t*********\n");
63
printf("\n\t\t\t<<<<<<<<<<WELCOME USERS>>>>>>>>>>\n");
64
printf("\n\n\t\t\t\t MENU\n");
65
printf("\t\t\t **");
66
printf("\n\t\t\t[1] VIEW INFORMATION\n");
67
printf("\n\t\t\t[2] BOOK TICKET\n");
68
printf("\n\t\t\t[3] CANCEL TICKET\n");
69
printf("\n\t\t\t[4] ADMIN");
70
printf("\n\n\t\t\t[5] EXIT\n");
71
printf("\n\t\t\t********");
72
printf("\n\t\t\t********");
73
printf("\n\t\t\tENTER YOUR CHOICE: ");
74
scanf("%d",&ch);
75
switch(ch)
76
{
77
case 1:
78
viewinfo();
79
break;
80
case 2:
81
bookticket();
82
break;
83
case 3:
84
cancelticket();
85
break;
86
case 4:
87
password();
88
break;
89
case 5:
90
system("cls");
91
printf("\n\t\t\t =========================================\n");
92
printf("\t\t\t *RAILWAY RESERVATION SYSTEM*\n");
93
printf("\t\t\t ===============================================\n");
94
printf("\n\n\t\t\tBMROUGHT TO YOU BY\n\n");
95
printf("\t\t\t\t*Learnprogramo*\n");
96
getch();
97
exit(0);
98
break;
99
default:
100
system("cls");
101
printf("\n\t\t\t==============================================\n");
102
printf("\t\t\t *RAILWAY RESERVATION SYSTEM*\n");
103
printf("\t\t\t ==============================================\n");
104
printf("\n\n\t\t\t<<<<<<<<YOU ENTERED WRONG CHOICE>>>>>>>>\n");
105
printf("\t\t\t<<<<<<<<PLEASE ENTER RIGHT THING>>>>>>>>\n");
106
getch();
107
system("cls");
108
main();
109
}
110
return 0;
111
}
112
//---------------------------------------main function close-----------------------------------------
---------
113
//---------------------------------------book ticket function-----------------------------------------
------
114
void bookticket()
115
{
116
int c,j,n,i,found=-1;
117
char v,train_number[10];
118
system ("cls");
119
aread();
120
printf("\n\n\t\t\t============================================");
121
printf("\n\t\t\t**RAILWAY RESERVATION SYSTEM**\n");
122
printf("\t\t\t==================================================");
123
printf("\n\n\t\t\thow many ticket do you want to buy: ");
124
scanf("%d",&n);
125
for(j=u;j<u+n;j++)
126
{
127
printf("\n\n\t\t\tEnter train number: ");
128
scanf("%s", book[j].train_number);
129
for(i=0;i<k;i++)
130
{
131
if(strcmp(book[j].train_number,add[i].train_number)==0)
132
{
133
if(add[i].seat==0)
134
{
135
printf("\n\n\t\t\tnot available seat");
136
137
getch();
138
system("cls");
139
main();
140
}
141
else
142
{
143
found=1;
144
printf("\n\t\t\tenter book %d no ticket: ",j+1);
145
printf("\n\t\t\tenter date: ");
146
scanf("%s",book[j].date);
147
printf("\n\t\t\tenter your name: ");
148
scanf("%s",book[j].name);
149
printf("\n\t\t\tenter your phone number: ");
150
scanf("%s",book[j].phone);
151
printf("\n\t\t\tseat number : %d",add[i].seat );
152
book[j].seat=add[i].seat;
153
bookticket_write();
154
add[i].seat--;
155
awrite();
156
}
157
}
158
}
159
if(found==-1)
160
{
161
printf("\n\n\t\t\ttrain not found!!!");
162
getch();
163
system("cls");
164
main();
165
}
166
}
167
u=j;
168
bookticket_write();
169
printf("\n\n\t\t\tenter '1' for main menu & press any key to exit: ");
170
scanf("%d",&c);
171
if(c==1)
172
{
173
system("cls");
174
main();
175
}
176
if(c!=1)
177
{
178
exit;
179
}
180
}
181
//---------------------------------------cancel ticket function---------------------------------------
------
182
void cancelticket()
183
{
184
viewpassengers_read();
185
char pnnmbr[100];
186
int location = -1,e;
187
printf ("\n\n\t\t\tenter phone number: ");
188
scanf ("%s",pnnmbr);
189
for (e=0;e<u;e++)
190
{
191
if (strcmp(pnnmbr,book[e].phone)==0)
192
{
193
location=e;
194
break;
195
}
196
}
197
if (location==-1)
198
{
199
printf ("\n\n\t\t\t<<<<<<<<<<<<<<Data Not Found>>>>>>>>>>>>>>>>> \n");
200
getch();
201
system("cls");
202
main();
203
}
204
else
205
{
206
for (e=location;e<u;e++)
207
{
208
strcpy(book[e].date,book[e+1].date);
209
strcpy(book[e].train_number,book[e+1].train_number);
210
strcpy(book[e].name,book[e+1].name);
211
strcpy(book[e].phone,book[e+1].phone);
212
bookticket_write();
213
}
214
u--;
215
bookticket_write();
216
printf("\n\n\t\t\t<<<<<<<<<<<<<<<ticket cancelled successfully>>>>>>>>>>>>");
217
getch();
218
system("cls");
219
main();
220
}
221
}
222
//-------------------------------------admin portal function----------------------------------------
223
void admin()
224
{
225
int chhh;
226
system("cls");
227
printf("\n
=================================================================="
);
228
printf("\n ****RAILWAY RESERVATION SYSTEM*******");
229
printf("\n
===================================================================
=");
230
printf("\n\n");
231
printf(" <<<<<<<<<<<<<<<WELCOME_ADMIN>>>>>>>>>>>>>>>\n");
232
printf("\n\n");
233
printf(" ********\n");
234
printf(" CHOOSE YOUR OPERATION \n");
235
printf(" --------------------------------\n");
236
printf(" [1] VIEW PASSENGERS \n");
237
printf(" [2] ADD TRAIN \n");
238
printf(" [3] DELETE TRAIN \n");
239
printf(" [4] BACK \n");
240
printf(" \n");
241
printf(" ********\n\n");
242
printf(" **************\n");
243
printf("\n\t\tENTER YOUR CHOICE: ");
244
scanf("%d",&chhh);
245
switch(chhh)
246
{
247
case 1:
248
viewpassenger();
249
break;
250
case 2:
251
addtrain();
252
break;
253
case 3:
254
dlttrain();
255
break;
256
case 4:
257
system("cls");
258
getch();
259
main();
260
break;
261
default:
262
getch();
263
printf("\n\t\t\tyou entered wrong KEY!!!!");
264
getch();
265
system("cls");
266
main();
267
}
268
getch();
269
}
270
//-----------------------------password function----------------------------------
271
void password()
272
{
273
int number=1234567;
274
int pass;
275
printf("\n\t\t\tenter password: ");
276
scanf("%d",&pass);
277
if(pass==number)
278
{
279
printf("\n\n\t\t\t<<<<<login successfully>>>>>");
280
getch();
281
system("cls");
282
admin();
283
}
284
else
285
{
286
printf("\n\n\t\t\t\t ERROR!!!!!");
287
printf("\n\n\t\t\t<<<<<<<<wrong password>>>>>>>>");
288
getch();
289
system("cls");
290
main();
291
}
292
}
293
//------------------------------------delete train function-------------------------------------------
---
294
void dlttrain()
295
{
296
aread();
297
char train[100];
298