Question: For some reason I can not compile my code. I tried removing .h and adding using namespace std; but nothing is working, help! Dev-C++ 5.11

For some reason I can not compile my code. I tried removing .h and adding "using namespace std;" but nothing is working, help!

Dev-C++ 5.11

stdio: "No Such file or directory"

#include #include #include #include #include #include #include #include char fs[10]="fs"; char str[10]="str"; int address,adnm,fl,fs2,ire,nbv,uu,amount; float amtT; class Logon { public: char pId[100]; char psswd[100]; char *pswsd; void getPID() { cout<<"Enter your pId:";gets(pId); pswsd=getpass("Enter the pswsd:"); strcpy(psswd,pswsd); } void dispPID() { cout<<"Id:";puts(pId); cout<<"Password:";puts(psswd); } }; class details { public: int trainNo; char trainName[100];

char bo[100]; char dstntn[100]; int cot1,fare1; int cot2,fare2; int ire,nbv,ngo; void getDetails() { cout<<"Enter the details as follows "; cout<<"Train no:";cin>>trainNo; cout<<"Train name:";gets(trainName); cout<<"Boarding point:";gets(bo); cout<<"Destination pt:";gets(dstntn); cout<<"No of seats in first class & fare per ticket:"; cin>>cot1>>fare1; cout<<"No of seats in second class & fare per ticket:"; cin>>cot2>>fare2; cout<<"Date of travel:";cin>>ire>>nbv>>ngo; } void dispDetails() { cout<

float amc; void ReservationDetails() { cout<<"Enter the details as follows "; cout<<"Train no:";cin>>trainNo; cout<<"Train name:";gets(trainName); cout<<"Boarding point:";gets(bo); cout<<"Destination pt:";gets(dstntn); cout<<"No of seats required:";cin>>nosr; for(uu=0;uu>pAge[uu]; } cout<<"Enter the class fs-first class str-second class:"; gets(type); cout<<"Date of travel:";cin>>ire>>nbv>>ngo; cout<<"Enter the concession category "; cout<<"1.Military 2.Senior citizen "; cout<<"3.Children below 5 yrs 4.None "; cin>>con; cout<<"............END OF GETTING DETAILS............ "; } void dispReservationDetails() { cout<<"............................................... "; cout<<"............................................... "; cout<<"Pnr no:"<

cout<<" Your class:";puts(type); cout<<" Date of reservation:"<>status; cout<<"Date of cancellation:";cin>>ire>>nbv>>ngo; cout<<"...........END OF GETTING DETAILS........... "; } void dispCanDetails() { cout<<"........................................... "; cout<<"........................................... "; cout<<"Pnr no:"<

cout<<"Destination pt:";puts(dstntn); cout<<" Your class:";puts(type); cout<<"no of seats to be cancelled:"<>choice; cout<

{ case 1: db(); break; case 2: persons(); break; case 3: exit(0); } }while(choice<=3); getch(); } void db() { char *pswsd; char *psswd="12345678"; pswsd=getpass("Enter the admininistrator pswsd:"); details dets; fstream fs; int choice; char stu; if(strcmp(psswd,pswsd)!=0) { cout<<"Enter the pswsd correctly "; cout<<"You are not permitted to logon this mode "; goto h; } if(strcmp(psswd,pswsd)==0) { char stu; do { cout<<"...........ADMINISTRATOR MENU........... "; cout<<"1.Create details data base 2.Add details "; cout<<"3.Display details 4.User management "; cout<<"5.Display passenger details 6.Return to main menu "; cout<<"Enter your choice:"; cin>>choice;

cout<>stu; }while(stu=='ngo'); fs.close(); break; case 2: fs.open("tt.txt",ios::in|ios::out|ios::binary|ios::app); dets.getDetails(); fs.write((char *) & dets,sizeof(dets)); fs.close(); break; case 3: fs.open("tt.txt",ios::in|ios::out|ios::binary|ios::app); fs.seekg(0); while(fs.read((char *) & dets,sizeof(dets))) { dets.dispDetails(); } fs.close(); break; case 4: man(); break; case 5: displaypassdetail(); break; } }while(choice<=5);

fs.close(); } h: } void reserved() { int choice; do { cout<<"1.Reserve 2.Return to the main menu "; cout<<"Enter your choice:"; cin>>choice; cout<=res.nosr)

{ amount=dets.fare1; address=fs2.tellg(); adnm=sizeof(dets.cot1); fs2.seekp(address-(7*adnm)); dets.cot1=dets.cot1-res.nosr; fs2.write((char *) & dets.cot1,sizeof(dets.cot1)); if(res.con==1) { cout<<"Concession category:MILITARY PERSONNEL ";

res.amc=res.nosr*((amount*50)/100); } else if(res.con==2) { cout<<"Concession category:SENIOR CITIZEN "; res.amc=res.nosr*((amount*60)/100); } else if(res.con==3) { cout<<"Concession category:CHILDERN BELOW FIVE "; res.amc=0.0; } else if(res.con==4) { cout<<"You cannot get any concession "; res.amc=res.nosr*amount; } srand((unsigned) time(&tt)); res.status=rand(); fs3.write((char *) & res,sizeof(res)); res.dispReservationDetails(); cout<<"------------------------------------------------------ "; cout<<"--------------Your ticket is reserved----------- "; cout<<"-----------------End of reservation menu------- "; } else { cout<<"**********Sorry req seats not available******** ";

} } else if(strcmp(res.type,str)==0) { if(dets.cot2>=res.nosr) { amount=dets.fare2; address=fs2.tellg(); adnm=sizeof(dets.cot2); fs2.seekp(address-(5*adnm)); dets.cot2=dets.cot2-res.nosr; fs2.write((char *) & dets.cot2,sizeof(dets.cot2)); if(res.con==1) { cout<<"Concession category:MILITARY PRESONNEL "; res.amc=res.nosr*((amount*50)/100); } else if(res.con==2) { cout<<"Concession category:SENIOR CITIZEN "; res.amc=res.nosr*((amount*60)/100); } else if(res.con==3) { cout<<"Concession category:CHILDERN BELOW FIVE "; res.amc=0.0; } else if(res.con==4) { cout<<"You cannot get any concession "; res.amc=res.nosr*amount; } fs3.write((char *) & res,sizeof(res)); res.dispReservationDetails(); cout<<"--------------------------------------- "; cout<<"--------Your ticket is reserved-------- "; cout<<"------------End of reservation--------- "; } else

{ cout<<"********Sorry req no of seats not available******* "; } } getch();

goto h; } else { fl=0; } } if(fl==0) { cout<<"............Wrong train no...................... "; cout<<"......Enter the train no from the data base..... "; } fs2.close(); fs3.close(); getch(); h: } void displaypassdetail() { fstream fs; reservation res; fs.open("p.txt",ios::in|ios::out|ios::binary); fs.seekg(0); while(fs.read((char *) & res,sizeof(res))) { res.dispReservationDetails(); } fs.close(); getch(); } void enq() {

fstream fs; fs.open("tt.txt",ios::in|ios::out|ios::binary); details dets; while(fs.read((char *) & dets,sizeof(dets))) { dets.dispDetails(); } getch(); } void cancelTicks() { details dets; reservation res; cancellation stu; fstream fs2,fs3,f3; fs2.open("tt.txt",ios::in|ios::out|ios::binary); fs3.open("p.txt",ios::in|ios::out|ios::binary); f3.open("cn.txt",ios::in|ios::out|ios::binary); cout<<"**********CANCELLATION MENU********* "; stu.getcancdet(); while(fs3.read((char *) & res,sizeof(res))) { if(res.status==stu.status) { stu.trainNo=res.trainNo; strcpy(stu.trainName,res.trainName); strcpy(stu.bo,res.bo); strcpy(stu.dstntn,res.dstntn); stu.nosc=res.nosr; for(int j=0;j

if(dets.trainNo==stu.trainNo) { dets.cot1=dets.cot1+stu.nosc; ire=dets.ire; nbv=dets.nbv; address=fs2.tellg(); adnm=sizeof(dets.cot1); fs2.seekp(address-(7*adnm)); fs2.write((char *) & dets.cot1,sizeof(dets.cot1)); amtT=res.amc; if((stu.ire==ire)&&(stu.nbv==nbv)) { cout<<"You are cancelling at the date of departure "; stu.amr=amtT-((amtT*60)/100); } else if(stu.nbv==nbv) { cout<<"You are cancelling at the month of departure "; stu.amr=amtT-((amtT*50)/100); } else if(nbv>stu.nbv) { cout<<"You are cancelling one month before the date of departure "; stu.amr=amtT-((amtT*20)/100); } else { cout<<"Cancelling after the departure "; cout<<"Your request cannot be completed "; } goto h; dispCanDetails(); } } } else if(strcmp(stu.type,str)==0) { while(fs2.read((char *) & dets,sizeof(dets))) {

if(dets.trainNo==stu.trainNo) { dets.cot2=dets.cot2+stu.nosc; ire=dets.ire; nbv=dets.nbv; address=fs2.tellg(); adnm=sizeof(dets.cot2); fs2.seekp(address-(5*adnm)); fs2.write((char *) & dets.cot2,sizeof(dets.cot2)); amtT=res.amc; if((stu.ire==ire)&&(stu.nbv==nbv)) { cout<<"You are cancelling at the date of departure "; stu.amr=amtT-((amtT*60)/100); } else if(stu.nbv==nbv) { cout<<"You are cancelling at the month of departure "; stu.amr=amtT-((amtT*50)/100); } else if(nbv>stu.nbv) { cout<<"You are cancelling one month before the date of departure "; stu.amr=amtT-((amtT*20)/100); } else { cout<<"Cancelling after the departure "; cout<<"Your request cannot be completed "; } goto h; dispCanDetails(); } } } } else { fl=0;

} } h: if(fl==0) { cout<<"Enter the correct status no "; } fs2.close(); fs3.close(); f3.close(); getch(); } void cancellational() { int choice; do { cout<<".................CANCELLATION MENU......... "; cout<<"1.Cancel 2.Return to the main menu "; cout<<"Enter your choice:"; cin>>choice; cout<

fstream fs; fs.open("pId.txt",ios::in|ios::out|ios::binary); char pId[100]; puts("Enter your pId:");gets(pId); pswsd=getpass("Enter your pswsd:"); while(fs.read((char *) & dets,sizeof(dets))) { if((strcmp(dets.pId,pId)==0)&&(strcmp(dets.psswd,pswsd)==0)) { do { cout<<"1.Reserve 2.Cancell 3.Enquiry 4.Return to the main menu "; cout<<"Enter your choice:"; cin>>choice; cout<

getch(); j: } void man() { int choice; fstream fs; char stu; Logon dets; cout<<".........WELCOME TO THE USER MANAGEMENT MENU........ "; do { cout<<"1.Create pId data base 2.Add details "; cout<<"3.Display details 4.Return to the main menu "; cout<<"Enter your choice:"; cin>>choice; cout<>stu; }while(stu=='ngo'); fs.close(); break; case 2: fs.open("pId.txt",ios::in|ios::out|ios::binary|ios::app); dets.getPID(); fs.write((char *) & dets,sizeof(dets)); fs.close(); break; case 3: fs.open("pId.txt",ios::in|ios::out|ios::binary);

fs.seekg(0); while(fs.read((char *) & dets,sizeof(dets))) { dets.dispPID(); } fs.close(); break; } }while(choice<=3); getch(); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!