Please help me out with the coding

Dear members,
I am a SE(CSE) student. I m completing a mini-project on BUS RESERVATION SYSTEM. I have ended up on a problem with the update and booking section. I have also completed with the password protection code. But the entire program starts getting problem on execution of that part. I am trying the program using file handling in c++. I have tried with most of the part but just have got these problems.
Please provide me with the necessary guidance and the logic if you can.

/*MINI PROJECT ON BUS RESERVATION SYSTEM*/

#include
#include
#include
#include
#include
#include
#include
#include

class bus
{
int busn,s,fare,i,seat;
char driver[10],arrival[5],depart[5],to[10],date[10],pas_name[20];

fstream x,z;

public:
    void install()
    {
    clrscr();
    z.open("data.txt",ios::app);

    cout<<"\n\n\t\t\t***** BUS RESERVATION SYSTEM *****\n\n";
    cout<<"\t\t\t*******INSTALL*******\n\n";
    for(i=0;i<1;i++)
    {
    cout<<"\n\tSource:Kolhapur";
    cout<<"\n\tEnter bus no: ";
    cin>>busn;
    cout<<"\n\tEnter driver's name: ";
    cin>>driver;
    cout<<"\n\tEnter destination:";
    cin>>to;
    cout<<"\n\tEnter fares:";
    cin>>fare;
    cout<<"\n\tEnter arrival time: ";
    cin>>arrival;
    cout<<"\n\tEnter departure time: ";
    cin>>depart;
    cout<<"\n\tEnter date (dd/mm/yy):";
    cin>>date;
    z<>ch1;
    clrscr();

    switch(ch1)
    {
    case 1:
    cout<<"Enter Bus no.:";
    cin>>busn;
    cout<<"Enter seat no.:";
    cin>>seat;
    cout<<"\n\tBus no.:"<>busn>>driver>>to>>fare>>arrival>>depart>>date;
        if(z.eof()==0)
        {
        cout<<"\nBus no.:"<>busn>>driver>>to>>fare>>arrival>>depart>>date;
        if(z.eof()==0)
        {
        cout<>ch;

switch(ch)
{
    case 1: b.install();
        break;
/*    case 2: b.booking();
        break;
    case 3: b.update();
        break;*/
    case 4: b.show();
        break;
/*    case 5: b.cancel();
        break;*/
    case 6: b.enquiry();
        break;
    case 7: exit(0);
}
}while(ch!=7);
getch();
}

Replies

You are reading an archived discussion.

Related Posts

I'm not an engineer and have no desire to reach any advanced level of Metallurgy, but I do work for a company that blends scrap stainless for manufacturing companies. The...
i think due to brittleness property of glass it is less elastic. suggest me the right
Hi All! Now, please explain to me the logic behind it.. all OS and memory stuff? why a system freezes and hangs and why sometimes all tricks fail and you...
Please help in the interpretation of a line from GALVIN: "A system may obscure the directory's existing files until the file system is unmounted, terminating the use of the file...
Hi everyone I m Btech ECE student graduating in 2011. I have admit from UTA for MS computer Engg. in Fall 2011 (Gre-1100, Toefl-95) And also I am placed in...