Page 382 - C++
P. 382
{
gotoxy(i,5) ;
cprintf(" ") ;
}
gotoxy(2,5) ;
printf(" Sno. FLIGHT NO. FROM TO ECONOMIC FAIR"
" EXECUTIVE FAIR") ;
textcolor(WHITE) ; textbackground(BLACK) ;
int row=7, sno=1 ;
while (file.read((char *) this, sizeof(TICKET)))
{
gotoxy(4,row);
cout<<sno ;
gotoxy(9,row) ;
cout<<fltno ;
gotoxy(20,row);
cout<<from ;
gotoxy(34,row);
cout<<to ;
gotoxy(52,row);
cout<<ecofair ;
gotoxy(67,row);
cout<<exefair ;
row++ ;
sno++ ;
}
file.close() ;
}
//---------------------------------------------------------------------------
// FUNCTION TO RESERVE TICKET FOR THE PASSANGER
//---------------------------------------------------------------------------
void RESERVE :: RESERVATION(void)
{
clrscr() ;
ENQUIRY() ;
char t1[5] = {0};
char pclass = {0};
char pname[26] = {0};
char paddress[36] = {0};
char psex = 0;
char pfltno[10]= {0} ;
int t2, valid, page, sno ;
PASSANGER p ;
memset(&p,0,sizeof(p));
int tno = p.LAST_TICKETNO() + 1 ;
do
{
valid = 1 ;
gotoxy(3,23) ;
cout<<" " ;
gotoxy(3,23) ;
cout<<"PRESS <ENTER> TO EXIT" ;
gotoxy(3,20) ;
cout<<" " ;
gotoxy(3,20) ;
cout<<"Enter Sno. of the FLIGHT: " ;
gets(t1);
t2 = atoi(t1);
sno = t2;
if (strlen(t1) == 0)
return ;
if (sno < 1 || sno > 12)
{