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";
}
}
}
Comments
Leave a comment