Answer to Question #10255 in C++ for Fayie

Question #10255
how to assign seats in c++ of each airlines plane with 10 rows [A-j] of 5 seats each
1
Expert's answer
2012-06-07T07:25:29-0400
how to assign seats in c++ of each airlines plane with 10 rows [A-j] of 5 seats each

using namespace std;

class seat{
public:
int num;
char row;
};

seat plane[10][5];

char Alphabet[] = { 'A','B','C','D','E','F','G','H','I','J' };

void main(){
for (int i=0; i<=9; i++){
for (int j=0; j<=4; j++){
plane[i][j].row = Alphabet[i];
plane[i][j].num = j;
cout<<Alphabet[i]<<"\n";
}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS