Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Title: ticket reservation coding
Description: in this railway ticket reservation project ful coding in c++ is given.
Description: in this railway ticket reservation project ful coding in c++ is given.
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
2012
Railway Ticket
Reservation
PRABHAVI PARASHAR
XII SCIENCE
PRABHAVI PARASHAR
COMPUTER PROJECT FILE
12/25/2012
RAILWAY TICKET RESERVATION
December 25,
2012
COMPUTER PROJECT
TRAIN RESERVATION
2
December 25,
2012
RAILWAY TICKET RESERVATION
Introduction
This is a project based on train reservation
...
Moreover & most
importantly the program helps us to reserve or cancel a train ticket
...
e
whether the ticket is confirmed or not
...
Data file handling has been
effectively used in the program
...
h>
#include
h>
#include
h>
#include
h>
#include
dat",ios::out);
fn
...
eof())
{
fn
...
close();
}
void tickets::reservation()
{
clrscr();
gotoxy(10,10);
cout<<"RESERVATION ";
gotoxy(10,12);
cout<<"ENTER THE TRAIN NO: ";
int tno,f=0;
cin>>tno;
ofstream file;
ifstream fin("Train1
...
seekg(0);
if(!fin)
{
clrscr();
gotoxy(10,10);
cout<<"ERROR IN THE FILE ";
15
RAILWAY TICKET RESERVATION
}
else
{
clrscr();
while(!fin
...
read((char*)&tr,sizeof(tr));
int z;
z=tr
...
returnaf();
nofas=tr
...
returnfs();
nofac=tr
...
returnss();
}
}
if(f==1)
{
file
...
dat",ios::app);
S:
clrscr();
gotoxy(10,10);
16
December 25,
2012
December 25,
2012
RAILWAY TICKET RESERVATION
cout<<"NAME:";
gets(name);
gotoxy(10,12);
cout<<"AGE:";
cin>>age;
clrscr();
gotoxy(10,10);
cout<<"SELECT THE CLASS WHICH YOU WISH TO TRAVEL";
gotoxy(10,12);
cout<<"1
...
A/C SECOND CLASS " ;
gotoxy(10,16);
cout<<"3
...
A/C CHAIR CAR " ;
gotoxy(10,20);
cout<<"5
...
write((char*)&tick,sizeof(tick));
break;
}
else
{
strcpy(status,"pending");
gotoxy(10,24);
cout<<"STATUS";
gotoxy(30,24);
puts(status);
gotoxy(10,26);
cout<<"RESERVATION NO";
gotoxy(30,26);
18
December 25,
2012
December 25,
2012
RAILWAY TICKET RESERVATION
cout<
file
...
write((char*)&tick,sizeof(tick));
break;
}
else
{
strcpy(status,"pending");
19
RAILWAY TICKET RESERVATION
gotoxy(10,24);
cout<<"STATUS";
gotoxy(30,24);
puts(status);
gotoxy(10,26);
cout<<"RESERVATION NO";
gotoxy(30,26);
cout<
file
...
write((char*)&tick,sizeof(tick));
break;
}
else
{
strcpy(status,"pending");
gotoxy(10,24);
cout<<"STATUS";
gotoxy(30,24);
puts(status);
gotoxy(10,26);
cout<<"RESERVATION NO";
gotoxy(30,26);
cout<
file
...
write((char*)&tick,sizeof(tick));
break;
}
else
{
strcpy(status,"pending");
gotoxy(10,24);
cout<<"STATUS";
gotoxy(30,24);
puts(status);
gotoxy(10,26);
cout<<"RESERVATION NO";
gotoxy(30,26);
cout<
file
...
write((char*)&tick,sizeof(tick));
break;
}
else
{
strcpy(status,"pending");
gotoxy(10,24);
cout<<"STATUS";
gotoxy(30,24);
puts(status);
23
RAILWAY TICKET RESERVATION
gotoxy(10,26);
cout<<"RESERVATION NO";
gotoxy(30,26);
cout<
file
...
close();
}
void tickets::cancellation()
{clrscr();
ifstream fin;
fin
...
dat",ios::out);
ofstream file;
file
...
dat",ios::app);
fin
...
eof())
{
fin
...
write((char*)&tick,sizeof(tick));
}
if(z==r)
{
f=1;
}
}
file
...
close();
remove("Ticket1
...
dat","Ticket1
...
";
getch();
}
else
{
gotoxy(10,12);
cout<<"RESERVATION CANCELLED";
getch();
}
}
26
December 25,
2012
December 25,
2012
RAILWAY TICKET RESERVATION
void main()
{
int ch,no,i,r=1000,j;
clrscr();
gotoxy(33,22);
cout<<"WELCOME";
delay(1500);
delay(1000);
Z:
clrscr();
gotoxy(25,8) ;
cout<<"RAILWAY TICKET RESERVATION";
gotoxy(25,9);
cout<<"==========================";
gotoxy(20,15) ;
cout<<"1
...
UPDATE TRAIN DETAILS ";
gotoxy(20,19);
cout<<"3
...
CANCELLING A TICKET";
gotoxy(20,23);
cout<<"5
...
EXIT";
textcolor(1);
gotoxy(20,27);
cout<<"ENTER YOUR CHOICE: ";
cin>>ch;
char n;
switch(ch)
{
case 1:ifstream fin("Train1
...
seekg(0);
clrscr();
if(!fin)
{
clrscr();
gotoxy(10,10);
cout<<"ERROR IN THE FILE !!!";
}
else
{clrscr();
while(!fin
...
read((char*)&tr,sizeof(tr));
tr
...
close();
goto Z;
case 2:clrscr();
gotoxy(20,10);
cout<<"ENTER THE PASSWORD " ;
cin>>j;
gotoxy(20,30);
cout<<"CHECKING PLEASE WAIT
...
dat",ios::app);
tr
...
write((char*)&tr,sizeof(tr));
fout
...
reservation();
goto Z;
case 4:tick
...
display();
goto Z;
case 6:exit(0);
}
getch();
}
30
December 25,
2012
December 25,
2012
RAILWAY TICKET RESERVATION
SAMPLE
OUTPUT
31
RAILWAY TICKET RESERVATION
OUTPUT
SCREEN SHOT 1
32
December 25,
2012
December 25,
2012
RAILWAY TICKET RESERVATION
SCREEN SHOT 2
SCREEN SHOT 3
33
RAILWAY TICKET RESERVATION
SCREEN SHOT 4
SCREEN SHOT 5
34
December 25,
2012
December 25,
2012
RAILWAY TICKET RESERVATION
SCREEN SHOT 6
SCREEN SHOT 7
35
RAILWAY TICKET RESERVATION
SCREEN SHOT 8
36
December 25,
2012
Title: ticket reservation coding
Description: in this railway ticket reservation project ful coding in c++ is given.
Description: in this railway ticket reservation project ful coding in c++ is given.