Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8775535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:49:25+00:00 2026-06-13T18:49:25+00:00

I need to mark seats entered by user with X and then display the

  • 0

I need to mark seats entered by user with X and then display the airplane layout (the array) again with the marked seats and repeat that every time. This is my code, I am kinda stuck. If you can please help me cut it down into two functions: first function should print out the array and the second function should takes user input and mark seats then call in the previous function to refresh the display.

My output should be something like this:

1 X B C D

2 A X C D

3 A B C D

4 A B X D

5 A B C D

6 A B C D

7 A B C D

My code is:

 #include <iostream>

    using namespace std;


    int main ()
    {
        int rowNumber=-1, columnNumber=-1;
        char columnLetter;
        char airplane[7][4] = {{'A', 'B', 'C', 'D'},
         {'A', 'B', 'C', 'D'},
         {'A', 'B', 'C', 'D'},
         {'A', 'B', 'C', 'D'},
         {'A', 'B', 'C', 'D'},
         {'A', 'B', 'C', 'D'},
         {'A', 'B', 'C', 'D'}};

         for (int i=0; i<7; i++)
         { 
             cout<<i+1<<"\t";

             for (int j=0; j<4; j++)
             {
                 cout<<airplane[i][j]<<"\t";   
             }

             cout<<"\n";
         }

       do
       {
       cout<<"Enter row number:"<<endl;
       cin>>rowNumber;
       }while ((rowNumber<1)||(rowNumber>7));

       do
       {
       cout<<"Enter column letter:"<<endl;
       cin>>columnLetter;
       }while (columnLetter!='A'&&columnLetter!='B'&&columnLetter!='C'&&columnLetter!='D');

       if (columnLetter=='A')
       {
          columnNumber=0;
       }
       else if (columnLetter=='B')
       {
          columnNumber=1;
       }
       if (columnLetter=='C')
       {
          columnNumber=2;
       }
       else if (columnLetter=='D')
       {
          columnNumber=3;
       }

       airplane[rowNumber][columnNumber]='X';

           system ("PAUSE");
           return 0;
    }

I tried this but it doesn’t compile so I can’t move to the next function that prints the marked seats:

#include <iostream>

using namespace std;
void fillArray (char array[][4]);

int main ()
{
   char airplane[7][4] = {{'A', 'B', 'C', 'D'},
     {'A', 'B', 'C', 'D'},
     {'A', 'B', 'C', 'D'},
     {'A', 'B', 'C', 'D'},
     {'A', 'B', 'C', 'D'},
     {'A', 'B', 'C', 'D'},
     {'A', 'B', 'C', 'D'}};

fillArray (airplane[][4]);     


       system ("PAUSE");
       return 0;
}

void fillArray (char array[][4])
{


     for (int i=0; i<7; i++)
     { 
         cout<<i+1<<"\t";

         for (int j=0; j<4; j++)
         {
             cout<<array[i][j]<<"\t";   
         }

         cout<<"\n";
     }
     return;
}

    enter code here
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:49:26+00:00Added an answer on June 13, 2026 at 6:49 pm

    Line 16 should be fillArray (airplane); instead of fillArray (airplane[][4]);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i made an array of all the places that i need to mark in
I've got a loop that will need to mark functions to run later, after
I have one requirement that I need to mark the table item when the
I need a MySQL pattern to match a number, followed by a question mark.
Need help with a query that I wrote: I have three tables Company id
I'm implementing RichFaces checkbox tree, and I've got a problem... I need to mark
When I run StyleCop, I got this error message saying that I need to
We need to mark up diagrams of body parts to indicate the location and
I want to construct a regex, that matches either ' or and then matches
I need to mark where certain observations appear in a 3D plotted joint density

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.