Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If someone could give me some guidance as how to get started or some sort of out

ID: 3619420 • Letter: I

Question

If someone could give me some guidance as how to get started or some sort of outline that would be great. Assume a small airplane with seat numbering as follows:
1 A B C D
2 A B C D
3 A B C D
4 A B C D
5 A B C D
6 A B C D
7 A B C D

The program should display the seat pattern, with an ‘X’ marking the seats already assigned. For example, after seats 1 A, 2 B, and 4 C are taken, the display should look 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

After displaying the seats available, the program prompts for the seat desired, the user types in a seat, and then the display of available seats is updated. This continues until all seats are filled or until the user signals that the program should end. If the user types in a seat that is already assigned, the program should say that seat is occupied and ask for another choice. If someone could give me some guidance as how to get started or some sort of outline that would be great. Assume a small airplane with seat numbering as follows:

Explanation / Answer

please rate - thanks #include<iostream>
using namespace std;
void display(char[][4],int,int);
int main()
{int row=7,col=4,total,used=0;
char seats[7][4],let[]={'A','B','C','D'},r,c;
int i,j;
for(i=0;i<row;i++)
    for(j=0;j<col;j++)
        seats[i][j]=let[j];
display(seats,row,col);
total=row*col;
for(;;)
{cout<<"Enter seat number (X to exit): ";
cin>>r;
r=toupper(r);
if(r=='X')
    {system("pause");
     return 0;
     }
cin>>c;
c=toupper(c);
i=r-49;
j=c-65;
if(i>6||j>3)
     cout<<"invalid seat ";
else if(seats[i][j]=='X')
     cout<<"seat already occupied ";
else
     {seats[i][j]='X';
      display(seats,row,col);
      used++;
      if(used==total)
          {cout<<"all seats full ";
           system("pause");
           return 0;
          }
      }

}
}
void display(char s[][4],int r,int c)
{int i,j;
for(i=0;i<r;i++)
    {cout<<i+1<<"   ";
     for(j=0;j<c;j++)
        {cout<<s[i][j]<<" ";
         if(j==c/2-1)
            cout<<" ";
         }
      cout<<endl;
    }
}
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote