Page 387 - C++
P. 387

t2 = atoi(t1);
         sno = t2 ;
         if (strlen(t1) == 0)
         return ;
         if (sno < 1 || sno > 12)
         {
         valid = 0 ;
         gotoxy(3,23)  ;
         cout<<"                                                          " ;
         gotoxy(3,23) ;
         cout<<"\7ENTER CORRECTLY" ;
         getch();
         }
         } while ( ! valid) ;
         clrscr() ;
         int row=7, found=0,flag=0;
         char ch ;
         gotoxy(3,3) ;
         cout<<"Flight no. " <<ticket.FLIGHTNO(sno) ;
         gotoxy(32,3) ;
         cout <<"LIST OF PASSANGER" ;
         textcolor(BLACK) ; textbackground(WHITE);
         gotoxy (2,5 ) ;
         printf(" TICKET NO.     NAME                                         CLASS"
                          "                               " ) ;
         textcolor(WHITE) ; textbackground(BLACK);
         fstream file ;
         file.open("PASS.DAT", ios :: in|ios::binary) ;
         file.seekg(0,ios::beg) ;
         while (file.read((char *) this, sizeof(PASSANGER)))
         {
         if (sno == slno)
         {
         flag = 0 ;
         found = 1 ;
         gotoxy(5,row) ;
         cout<<ticketno ;
         gotoxy(17,row) ;
         cout <<name ;
         gotoxy(49,row) ;
         if (Class == 'X')
         cout       <<"Executive" ;
         else
         cout<< "Economic" ;
         if ( row == 21 )
         {
         flag = 1 ;
         row = 7 ;
         gotoxy(5,23);
         cout <<"Press any key to continue or Press "
                         "<ESC> to exit" ;
         ch = getch() ;
         if (ch == 27)
         break ;
         clrscr() ;
         gotoxy(32,3) ;
         cout<<"LIST OF PASSANGER" ;
         textcolor(BLACK) ; textbackground(WHITE) ;
         gotoxy(2,5) ;
         cprintf(" TICKET NO.        NAME                          "
                          "              FLIGHT NO.                          CLASS "
                          "                ") ;
         textcolor(WHITE) ; textbackground(BLACK) ;
         }
   382   383   384   385   386   387   388   389   390   391   392