//PROGRAM - TRAIN RESERVATION
#include<stdlib.h>
#include<process.h>
#include<stdio.h>
#include<dos.h>
#include<fstream.h>
#include<iostream.h>
#include<conio.h>
#include <string.h>
class train
{ private :
int trainno,
nofafseat,nofasseat,noffsseat,nofacseat,nofssseat;
char trainname[60],startingpoint[60],destination[60];
public : train()
{ trainno=0; nofafseat=0;
nofasseat=0;
noffsseat=0;
nofacseat=0;
nofssseat=0;
strcpy(trainname,"/0");
strcpy(startingpoint,"/0");
strcpy(destination,"/0"); }
void input(); //To input the details
void display(); //To display the details
int returntr();
int returnaf();
int returnas(); int returnfs();
int returnac(); int returnss();
}tr; // object of class
int train::returntr()
{ return trainno; }
int train::returnaf()
{ return nofafseat; }
int train::returnas()
{ return nofasseat; }
int train::returnfs()
{ return noffsseat; }
int train::returnac()
{ return nofacseat; }
int train::returnss()
{ return nofssseat; }
void train::input()
{ clrscr(); gotoxy(10,10);
cout<<"ENTER THE TRAIN NUMBER "; gotoxy(57,10);
cin>>trainno; gotoxy(10,12);
cout<<"ENTER THE NUMBER OF A/C FIRST CLASS SEATS";
gotoxy(57,12);
cin>>nofafseat; gotoxy(10,14);
cout<<"ENTER THE NUMBER OF A/C SECOND CLASS SEATS";
gotoxy(57,14);
cin>>nofasseat; gotoxy(10,16);
cout<<"ENTER THE NUMBER OF FIRST CLASS SLEEPER SEATS";
gotoxy(57,16); cin>>noffsseat;
gotoxy(10,18);
cout<<"ENTER THE NUMBER OF A/C CHAIR CAR SEATS";
gotoxy(57,18);
cin>>nofacseat;
gotoxy(10,20);
cout<<"ENTER THE NUMBER OF SECOND CLASS SLEEPER SEATS";
gotoxy(57,20);
cin>>nofssseat; gotoxy(10,22);
cout<<"ENTER THE TRAIN NAME"; gotoxy(57,22);
gets(trainname); gotoxy(10,24);
cout<<"ENTER THE STARTING POINT "; gotoxy(57,24);
gets(startingpoint); gotoxy(10,26);
cout<<"ENTER THE DESTINATION ";
gotoxy(57,26); gets(destination);
void train::display()
{
clrscr();
gotoxy(10,10);
cout<<"TRAIN NUMBER ";
gotoxy(47,10);
cout<<trainno;
gotoxy(47,12);
puts(trainname);
gotoxy(10,14);
cout<<"NO OF A/C FIRST CLASS SEATS ";
gotoxy(47,14);
cout<<nofafseat;
gotoxy(10,16);
cout<<"NO OF A/C SECOND CLASS SEATS ";
gotoxy(47,16);
cout<<nofasseat;
gotoxy(10,18);
cout<<"NO OF FIRST CLASS SLEEPER SEATS ";
gotoxy(47,18);
cout<<noffsseat;
gotoxy(10,20);
cout<<"NO OF A/C CHAIR CLASS SEATS ";
gotoxy(47,20);
cout<<facseat;
gotoxy(10,22);
cout<<"NO OF SECOND CLASS SLEEPER SEATS ";
gotoxy(47,22)
cout<<nofssseat;
gotoxy(10,24);
cout<<"STARTING POINT ";
gotoxy(47,24);
puts(startingpoint);
gotoxy(10,26);
cout<<"DESTINATION ";
gotoxy(47,26);
puts(destination);
gotoxy(10,28); c
out<<"PRESS ANY KEY TO CONTINUE ";
getch();
}
class tickets
{ int resno,toaf,nofaf,toas,nofas,tofs,noffs,toac,nofac,toss,nofss,age;
char status[40],name[40];
public: tickets();
void reservation(); //For ticket reservation
void cancellation(); //For ticket cancellation int ret();
void display(); //To display reservation details }tick;
tickets::tickets()
{ resno=0;
toaf=0;
nofaf=0;
toas=0;
nofas=0;
tofs=0;
noffs=0;
toac=0; nofac=0;
toss=0;
nofss=0;
age=0;
strcpy(status,"/0");
strcpy(name,"/0");
}
int tickets::ret()
{ return resno;
}
void tickets::display()
{ int f=0; clrscr();
ifstream fn("Ticket1.dat",ios::out);
fn.seekg(0);
if(!fn)
{ cout<<"ERROR IN THE FILE "; }
X:
gotoxy(10,10);
cout<<"ENTER THE RESERVATION NO ";
gotoxy(10,12);
int n;
cin>>n;
Can you just post the error as reported by the compiler please. You can't expect us to dig out and configure a 20 year old Borland compiler to process that code.
Also, please use the code formatting tags around code. It's near impossible to read code unformatted.