Sunteți pe pagina 1din 24

SCHOOL OF INFORMATION TECNOLOGY AND ENGINEERING

RAILWAY RESERVATION

Done by

Shamil Iqbal Tp (18BCA0045)


Arjun J (18BCA0046)
Dhayanadhan (18BCA0048)

For the course

Course Code: ITA3001


Course Name: Object Oriented Programming

Semester: Fall 2019


Content

Sno. Topic Page Number


1 Abstract 1
2 Introduction 2
3 Architectural Diagram 4
4 Sample Code 7
5 Screenshots 19
5 Conclusion 24
Abstract

Our project introduces railway reservation system with an objective to make the
reservation system more efficient, easier and fast. This project explores how computer
technology can be used to solve the problem of user.

The main objectives provided by this software are as follows:

 We can enquire about availability of trains

 We can reserve and cancel their seats

 We can modify the information related to

This project is dedicated to model existing railway reservation systems that aim at
development of Railway Reservation System that facilitates the railway customer to
manage their reservations and the railway administrator to modify the backend
database in a user-friendly manner

In this emerging world of computers, almost all-manual system has switched to


automated and computerized system. Therefore, we are developing the software for
“Railway Reservation System” to model the present system and to remove the
drawbacks of the present system. This project explores how computer technology can
be used to solve the problem of user.
INTRODUCTION

This project introduces railway reservation system. It explains how reservation is


being done in Indian Railways. The systematic procedure is explained. This project is
developed in C++ language. All most all the header files have been used in this
project. Proper comments have been given at desired locations to make the project
user friendly. Various functions and structures are used to make a complete use of this
language.

The customers are required to register on the server for getting access to the database
and query result retrieval. Upon registration, each user has an account that is
essentially the ‘view level’ for the customer. The account contains comprehensive
information of the user entered during registration and permits the customer to get
access to his/her past reservations, enquire about travel fare and availability of seats,
make fresh reservations, and update his account details. Each passenger is allotted a
unique PNR no. through which one can access his/her account.
The railway administrator is another member involved in the transactions. The
administrator is required to login using a master password, once authenticated as an
administrator, one has access and right of modification to all the information stored in
the database. This includes the account information of the customers, attributes and
statistics of stations, description of the train stoppages and physical description of
coaches, all the reservations that have been made. The railway administrator has the
right to modify any information stored at the server database.

This project is dedicated to model the existing railway reservation system that aims at
development of Railway Reservation System that facilitates the railway customer to
manage their reservations and the railway administrator to modify the backend
database in a user-friendly manner. The customer and the railway administrator are
two parties that interact with the database, who have different ‘view level schemas’ to
the database information. The software provides a comprehensive set of features to
enhance the operational limits.
Now one can easily plan the journey comfortably as the process is efficient and fast
with being easy to access. The efficiency of the railway will increase result of
computerization.

This being a big step in terms of improvement in the railway system it is widely
accepted across the country. Rather than designing manually, we have made use of
computer. Use of computer has solved many problems, which are faced during manual
calculation. Once data are fed, it can perform accurate functions. Therefore, to reduce
the complexity and efficiency a versatile and an outsourcing railway reservation
system has been developed.

This system is basically concerned with the reservation and cancellation of


railway tickets to the passengers. The need of this system arose because as is the
known fact that India has the largest railway network in the whole of the world
and to handle it manually is quite a tough job. The long distance road network is
very poorly developed in most parts of India. Bulk of long distance traffic is
carried by the Indian Railway as a result Indian railways. Therefore, forms a
backbone of public transport in India. The efficiency of the railway will increase
result of computerization due to dramatic reduction in communication time among
geographically dispersed offices. For the reservation of the ticket a person goes to
ticket counter of the railway reservation office and expend its valuable time in
standing queue. Now to save that time we have a facility of Online Reservation
now we can book cancel or search other train information just by click on
computer.
ARCHITECTURE DIAGRAM

E-R DIAGRAM

NAME
NAME
PNR No. AGE
N AME

RESERV
CUSTOMER RESERVATION
E OFFICER

GENDER DEPT.
AGE

DEPT.

ENQUIRY ENQUIRY
OFFICER

AGE
NAME
USE CASE DIAGRAM
Sequence diagram
Sample code

#include <conio.h>
#include <cstdio>
#include <iostream>
#include <string.h>
#include <cstdlib>
using namespace std;
static int p = 0;

class a

char train_no[5], train_name[10], arrival[5], depart[5], from[10], to[10], seat[8][4][10];

public:

void install();
void allotment();
void empty();
void show();
void avail();
void position(int i);

train[10];

void vline(char ch)

for (int i=80;i>0;i--)


cout<<ch;

void a::install()

cout<<"Enter Train no: ";


cin>>train[p].train_no;
cout<<"\nEnter Train name: ";
cin>>train[p].train_name;
cout<<"\nArrival time: ";
cin>>train[p].arrival;
cout<<"\nDeparture: ";
cin>>train[p].depart;
cout<<"\nFrom: \t\t\t";
cin>>train[p].from;
cout<<"\nTo: \t\t\t";
cin>>train[p].to;

train[p].empty();

p++;

void a::allotment()

int seat;
char number[5];

top:

cout<<"Train no: ";

cin>>number;

int n;

for(n=0;n<=p;n++)

if(strcmp(train[n].train_no, number)==0)

break;

while(n<=p)

cout<<"\nSeat Number: ";

cin>>seat;

if(seat>32)

cout<<"\nThere are only 32 seats available in this bus.";


}

else

if (strcmp(train[n].seat[seat/4][(seat%4)-1], "Empty")==0)

cout<<"Enter passanger's name: ";

cin>>train[n].seat[seat/4][(seat%4)-1];

break;

else

cout<<"The seat no. is already reserved.\n";

if(n>p)

cout<<"Enter correct bus no.\n";

goto top;
}

void a::empty()

for(int i=0; i<8;i++)

for(int j=0;j<4;j++)

strcpy(train[p].seat[i][j], "Empty");

void a::show()

int n;

char number[5];

cout<<"Enter Train no: ";


cin>>number;

for(n=0;n<=p;n++)

if(strcmp(train[n].train_no, number)==0)

break;

while(n<=p)

vline('*');

cout<<"Train no: \t"<<train[n].train_no


<<"\nTrain name: \t"<<train[n].train_name<<"\t\tArrival time: \t"
<<train[n].arrival<<"\tDeparture time:"<<train[n].depart
<<"\nFrom: \t\t"<<train[n].from<<"\t\tTo: \t\t"<<
train[n].to<<"\n";
vline('*');

train[0].position(n);

int a=1;

for (int i=0; i<8; i++)

{
for(int j=0;j<4;j++)

a++;

if(strcmp(train[n].seat[i][j],"Empty")!=0)

cout<<"\nThe seat no "<<(a-1)<<" is reserved for "<<train[n].seat[i][j]<<".";

break;

if(n>p)

cout<<"Enter correct Train no: ";

void a::position(int l)

int s=0;p=0;

for (int i =0; i<8;i++)

{
cout<<"\n";

for (int j = 0;j<4; j++)

s++;

if(strcmp(train[l].seat[i][j], "Empty")==0)

cout.width(5);

cout.fill(' ');

cout<<s<<".";

cout.width(10);

cout.fill(' ');

cout<<train[l].seat[i][j];

p++;

else

cout.width(5);
cout.fill(' ');

cout<<s<<".";

cout.width(10);

cout.fill(' ');

cout<<train[l].seat[i][j];

cout<<"\n\nThere are "<<p<<" seats empty in Bus No: "<<train[l].train_no;

void a::avail()

for(int n=0;n<p;n++)

vline('*');

cout<<"Bus no: \t"<<train[n].train_no<<"\nDriver: \t"<<train[n].train_name

<<"\t\tArrival time: \t"<<train[n].arrival<<"\tDeparture Time: \t"


<<train[n].depart<<"\nFrom: \t\t"<<train[n].from<<"\t\tTo: \t\t\t"

<<train[n].to<<"\n";

vline('*');

vline('_');

int main()

system("cls");

int w;

cout<<"\n\t\t\t****************************************\n";
cout<<"\t\t\t****************************************\n";
cout<<"\t\t\t*******RAILWAY RESERVATION SYSTEM*******\n";
cout<<"\t\t\t****************************************\n";
cout<<"\t\t\t*****By Shamil Arjun Dhayanadhan********\n";
cout<<"\n\t\t\t <<<<<<<<<<WELCOME USERS>>>>>>>>>>\n";

while(1)

cout<<"\n\n\n\n\n";
cout<<"\t\t\t****************************************\n";
cout<<"\t\t\t1.Train Registration\n";
cout<<"\t\t\t****************************************\n\n";
cout<<"\t\t\t2.Ticket Reservation\n\t\t\t"

<<"3.Show Tickets \n\t\t\t"

<<"4.Train Available. \n\t\t\t"

<<"5.Exit";

cout<<"\n\t\t\tEnter your choice:-> ";

cin>>w;

switch(w)

case 1: train[p].install();

break;

case 2: train[p].allotment();

break;

case 3: train[0].show();

break;

case 4: train[0].avail();

break;
case 5: exit(0);

return 0;

}
Screenshots
Conclusion

This system is basically concerned with the reservation and cancellation of


railway tickets to the passengers. The need of this system arose because as is the
known fact that India has the largest railway network in the whole of the world
and to handle it manually is quite a tough job. The long distance road network is
very poorly developed in most parts of India. Bulk of long distance traffic is
carried by the Indian Railway as a result Indian railways.

If anyone wants to extend this project, then they can make an additional database of
Train Fare. And database for updated availability of seats which is available after the
cancellation of ticket on that specific train etc. He/she can also add some more
command buttons in the existing software and extend working of the existing
software.

Implementations of this project idea are in industrial use. Hence, this can be used for
suggesting improvements in design, performance and greater usability. Apart from the
industrial applications, it is a research-oriented project as well, the task of
performance evaluation of different database designs, for efficiency, is in this spirit.

S-ar putea să vă placă și