seat pattern

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 1051109210
    New Member
    • Mar 2007
    • 29

    #1

    seat pattern

    im suppose to do a "airplane sitting" program

    1 a b c d
    2 a b c d
    3 a b c d
    (till 7)

    den if i ask a user to type in their seats...

    1 a b x d
    2 a x c d
    3 a b c d
    (till 7)

    pick seats will become "x"

    now im stuck...
    Code:
    #include <iostream>
    #include <cstring>
    using namespace std;
    
    int main()
    {
        int i,n,len;
        char x[3];
        char status[15];
        
        cout<<"This is an airplane passengers seats program"<<endl<<endl;
        
        for(n=1;n<=7;n++){
        cout<<n<<" \tA\tB\tC\tD"<<endl<<endl;
        }
    
        cout<<"Please enter your seat accordingly : ";
        cin.getline(x,3);
        cout<<endl;
        len=strlen(x);
       
       // for (i=0;i<=len;i++)
       // x[i]=toupper(x[i]);
    
        for(int j=1;j<=7;j++){
        cout<<j<<" \tA\tB\tC\tD"<<endl<<endl;
        }
            
        
        
        
        
        cout<<"Thank you for using this program"<<endl;
        cout<<"Have a nice day"<<endl;
        
        system("pause");
        return 0;
    }
    Last edited by horace1; Apr 2 '07, 05:53 AM. Reason: added code tags
Working...