View Single Post
  #1 (permalink)  
Old September 5th, 2003, 03:36 PM
Raineri33 Raineri33 is offline
Registered User
 
Join Date: Sep 2003
Location: Myrtle Beach, SC, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default AIRPLANE SEAT CHART..... PLEASE HELP

I am new to c++, and i have a program to do as follows:
 1) fill a 2D array for the seat chart with * ... DONE
 2) add a passenger to the plane
     I am stuck here, i have the info put into the cin statements etc, but how do i make it so that it makes an 'X' in the seat that they want to sit in ?????
 3) sort the list of passengers added
     I have written a selection sort as follow: (can anyone tell me why it will not compile with code?
//prototype: void print_list(pass_rec passlist[size] ,int );
//function call: print_list(passlist,count);
void print_list(pass_rec passlist,int count)
{
    int min_loc=0;
    pass_rec temp;
    for(int pass=1; pass < count; pass++)
    {
        min_loc = pass-1;
        for(int i = pass; i < count; i++)
        {
            if(passlist[min_loc] > passlist[i])
                min_loc = i;
        }
        if(min_loc != pass-1)
        {
            temp.lname = passlist[min_loc].lname;
            passlist[min_loc] = passlist[pass-1];
            passlist[pass-1] = temp;
        }
        cout << passlist[min_loc] << endl;
    }
    system("pause");
}

PLEASE ANYONE HELP
Reply With Quote