Write a C program to assign passengers seat in an airplane. 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 The program should display the seat pattern with a ‘X’ marking the already assigned.For example: After seats 1A, 2B and 4C are taken the display should be 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 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 the 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.
- Write a C
program to assign passengers seat in an airplane. 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
The program should display the seat pattern with a ‘X’ marking the already assigned.For example: After seats 1A, 2B and 4C are taken the display should be
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
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 the 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.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images