Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 5

Code :

#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<stdlib.h>
#include<dos.h>
#include<string.h>
#include<math.h>

gotoxy(17,12);
printf("1. For reservation press 1
");
gotoxy(17,14);
printf("2. For cancellation press 2
");
gotoxy(17,16);
printf("3. For enquiry press 3
");
gotoxy(17,18);
printf("4. For closing the program press 4
");
gotoxy(48,25);
printf("Created by suganya and team.");
gotoxy(20,20);
printf("Choice : ");
scanf("%d",&choice);
switch(choice)
{
case 1:
reserv();
break;
case 2:
closegraph();
clrscr();
cancel();
break;
getch();
clearline(24);
}
}while(flag==0);
gotoxy(x,y);
puts(passenger.passen[i]);
i++;
return(i);
}
int pass_sex(int j,int x,int y)
{
int flag,i;
char ch[1][1];
do
{
flag=
clearline(24);
}
}while (flag==0);
gotoxy(x,y);
puts(passenger.sex[j]);
j++;
return(j);
}
int pass_age(int k,int x,int y)
{
int flag,i,j;
do
{
flag=1;
gotoxy(x,y);
if(flag==1)
flag=0;
getch();
}
gotoxy(1,1);
}
void setgraph()
{
clrscr();
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "c:\tc\bgi");
/* read result of initialization */
errorcode = graphresult();
/* an error occurred */
if (errorcode != grOk)
{
printf("Graphics error: %s
", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
xmax = getmaxx()/2;
ymax = getmaxy()/2;
}
char tno[3],ans;
char a[1],c,age[3],ch;
char *p;
FILE *ptr,*pno,*tr;
closegraph();
highvideo();
//Design Part
clear();
drawbox();
gotoxy(3,2);
for(i=0;i<74;i++)
printf("Ä");
j=3;
for(i=0;i<4;i++)
{
gotoxy(3,j);
printf("³");
gotoxy(77,j);
printf("³");
j++;
}
gotoxy(3,6);
for(i=0;i<75;i++)
printf("Ä");
gotoxy(6,2);
printf(" Journey Details ");
color(1
gotoxy(3,j);
printf("³");
gotoxy(77,j);
printf("³");
j++;
}
gotoxy(3,23);
printf("");
gotoxy(3,23);
for(i=0;i<74;i++)
printf("Ä");
gotoxy(4,10);
for(i=0;i<73;i++)
printf("Ä");
color(8,31,11);
gotoxy(22,9);
printf("NAME");
gotoxy(46,9);
printf("SEX");
gotoxy(53,9);
printf("AGE");
gotoxy(65,9);
printf("REMARKS");
j=9;
for(i=0;i<14;i++)
{
gotoxy(44,j);
printf("³");
gotoxy(51,j);
prin
if(found==2)
{
gotoxy(8,24);
printf("This Train No does not exist");
getch();
clearline(24);
gotoxy(15,3);
flag=1;
}
}while(strlen(passenger.tno)!=4||flag==1);
if(found==0)
{
gotoxy(32,3);
puts(train.tname);
found=1;
}
fflush(stdin);
do
{
flag=1;
gotoxy(12,5);
fflush(stdin);
scanf("%[^
]",passenger.from);
fflush(stdin);
strupr(passenger.from);
if (strlen(passenger.from) == 0)
{
gotoxy(10,24);
printf("aFrom field should not be left BLANK");
flag=0;
getch();
clearline(24);
}
else if (strlen(passenger.from) != 3)
{
gotoxy(10,24);
printf("aFrom should be equal to 3 characters");
flag=0;
getch();
clearline(24);
}
for(i=0;i<3;i++)
{
ch=passenger.from[i];
if(isdigit(ch))
}
for(i=0;i<3;i++)
{
ch=passenger.to[i];
if(isdigit(ch))
{
gotoxy(10,24);
printf("aEnter a valid Destination Place");
flag=0;
getch();
clearline(24);
break;
}
}
}while (flag==0);
gotoxy(27,5);
puts(passenger.to);
i=j=k=0;
gotoxy(67,5);
while(c!=13)
{
fflush(stdin);
c=getch();
if((c<'0'||c>'9')&&c!=13&&c!=8)
{
if(c==27)
return;
gotoxy(5,24);
printf("Please Enter Valid Date.");
getch();
gotoxy(67,5);
printf(" ");
gotoxy(5,24);
clearline(24);
gotoxy(67,5);
{
age[count1]='

You might also like