We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 20
A Project Report On
RAILWAY TICKET RESERVATION
nn 0
1963 J 2013
——=_=___=_=—
—S—
a a TA TP
oada frarera Wer NABET
Submitted By
RAHUL KUSHWAHA
Class : XILA
Under the Guidance of
Mr. Anil Kumar
PGT (Computer Science)
Department of Computer Science
Kendriya Vidyalaya No. 2, Nausenabaugh
Visakhapatnam.Ny ie Department of Computer Science
~~~ Kendriya Vidyalaya No. 2, Nausenabaugh
TEES Visakhapatnam
dette freer tie
CERTIFICATE
This is to certify that RAHUL KUSHWAHA
Of Class XII A has prepared the report on the Project entitled
“Railway Ticket Reservation”. The report is the result of his
efforts & endeavors. The report is found worthy of acceptance
as final project report for the subject Computer Science of Class
XII. He has prepared the report under my guidance.
(Mr. Anil Kumar)
PGT (Computer Science)
Department of Computer Science
Kendriya Vidyalaya No.2,
Nausenabaugh,
Visakhapatnam.s\} {i Department of Computer Science
= oi Kendriya Vidyalaya No. 2, Nausenabaugh
Te 50 ah Visakhapatnam
1963 2
—S=—
CERTIFICATE
The project report entitled
“Railway Ticket Reservation’
Submitted by RAHUL KUSHWAHA of Class XII A for
the CBSE Senior Secondary Examination class XII of
Computer Science at Kendriya Vidyalaya No. 2,
Nausenabaugh Visakhapatnam has been examined.
”
?
SIGNATURE OF EXAMINERDECLARATION
I hereby declare that the project work entitled
“Railway Ticket Reservation”, submitted to
Department of Computer Science, Kendriya
Vidyalaya No. 2, Nausenabaugh,
Visakhapatnam is prepared by me. All the
coding are result of my personal efforts.
RAHUL KUSHWAHA
Class XII AACKNOWLEDGEMENT
I would like to express a deep sense of thanks & gratitude to my
project guide Mr. Anil Kumar Sir for guiding me immensely through the
course of the project. He always evinced keen interest in my work. His
constructive advice & constant motivation have been responsible for the
successful completion of this project.
My sincere thanks goes to Shri S.V. Babu, Our principal sir, for his
co-ordination in extending every possible support for the completion of
this project.
Talso thanks to my parents for their motivation & support. I must
thanks to my classmates for their timely help & support for compilation
of this project.
Last but not the least, I would like to thank all those who had
helped directly or indirectly towards the completion of this project.CONTENTS
6. CONCLUSION. ............0eeee eee
7. BIBLIOGRAPHY, ......00ss0ceceeeeesHEADER FILES USED
1. FSTREAM.H ~ for file handling, cin and cout
2. PROCESS.H — for exit function
8. CONIO.H — for clrscr() and getchQ)
functions
4, STDIO.H — for standard I/O operations
5. STRING.H — for string handling
6. MATH.H-for doing mathematical operationsFILES GENERATED
DATA FILES
TRAIN.DAT
PROGRAM FILE
RAILWAY TICKET RESERVATION.CPP
OBJECT FILE
TRAIN.OBJ
EXECUTION FILE
TRAIN. EXEWORKING DESCRIPTION
This program is designed to keep the friend’s
record.
This program consists of FIVE options as
follows
. TO ADD NEW RAILWAY STATION
. TO BOOK TICKET
. TO CHANGE PER KM RATES
. TO MODIFY DATABASE OF TRAIN
TO EXIT
yu Fw hyeCODING
//Indian Railways ~ Ticket Reservation
//Submitted By RAHUL KUSHWAHA
#include
#include
#include
#include
#include
#include
char from[30],to[30];
void detailO
fl
{
cout<<"From"<>distance;
\
void amount(int a,int b,int c)fl
{
cout<<"total distance="< >distance;
pry
void main()
fl
{
clrscr0;
unsigned int per_km=5,choice, d1=0,d2=0,i;
char station_searched[30];
while(1)
f
{
clrscr0);
cout<<"\n\t\t\ [WELCOME TO INDIAN RAILWAYS\n";,
for(i=03i<80;i++)
‘
t
couts<"-";\
cout<<"Enter your choice \n\t1:->Add new railway station \n\t2:-
>Book ticket"<Change per km rates\n\t4:->modify database of
train\n\t5:->exif\n";
forli=0;i<80;i++)
(
{
cout<<"-";
1
cin>>choic
while(choice:
Hi
{
ofstream of 1 ("train.dat’,ias::binary | ios:app);
tr.ad_dataQ);
of l.write((char") tr sizeof(tr));
of L.close();
break;
}
while (choice==2)
fl
{
ifstream of! ("train.dat',ios::binary);
detail;
while (ofl)
i
{
ofl read ((char*)&tr,sizeof(tr));
if(O==stricmp(from,tr.station_vQ))
i
di=tr.dist();
\if(0:
5
{
d2=trdist0;
stricmp(to,tr.station_vO))
1
if(d] &&d2)
fl
{
tr.amount(d1,d2,per_km);
getch();
break,
i
iffofl eof)
‘
cout<<"\nstations not found check your spelling\n";
getch();
1
i
of 1.closeQ);
on
‘out<<"Enter new per km rates";
cin>>per_km;
1
if(choice==4)
f
{
cout<< "enter the railway station to be changed";
gets(station_searched);
ifstream f1 ("train.dat"ios::binary);
while(f1)5
f Lread((char*) &tr,sizeof(tr));
long pos=fl tellg0;
if(O==stromp(station_searched,tr.station_vQ))
5
{
f Lscekg((- I*sizeof (tr) i ur);
trmodity0;
fl.closeQ;
ofstream f1("train.dat"jos::app);
f Lseekp(pos,ios::beg);
f Lwrite((char*) &tr,sizeof(tr));
cout<<"record modified";
fL.close();
break;
\
else if(f1.cofO)
‘
{
cout<<"\nStation not found\n";
getch0;if(choic
cout<<"\nTHANK YOU FOR USING INDIAN RAILWAYS ";
getch();
exit);
if(choicel=1&&choice!=2&&choice!=3KKchoicel=4&&choicel=5)
cout<<"entered wrong choice PROGRAM IS ABORTINGITTIT";
getch;
exit);
getch0);OUTPUT
2. ADD NEW RAILWAY STATION
CAUSERAWD@ MADE
CCRC3. TO BOOK TICKET
CUSERS WDB YIDESTOM
4. TO CHANGE PER KM RATES
ee eeVELOOME TO INDIAN RATLAIYS
Sena ote
Mid new railuay station
mec
rte
Ser pee eee eet
Pi
eC or
eee
roretay
WELCOME TO INDIAN RATIAWYS
Se rs
eer rae
ees Ont
Change per ke rate
eet
eooeronete Srey
rotaTO EXIT
USES ENDS
ToC OC es
Enter your choice
Can:
UR eee oo
een er
or a
Sie
eCOLBIBLIOGRAPHY
1 http://www.google.com/
2 http://en.wikipedia.org
3 Computer Science with C++ by Sumita
Arora
4 Object Oriented Programming by Robert
Lafore
5 www.bOtskOOL.com