Can you please help me solve this in C language? I did encounter and solve this problem with Java but I cannot seem to implement the use of structures in solving this problem. Help is appreciated, thank you. Using the concept of structures, write a program to assign passenger seats in an airplane. Assume a small airplane with seats numbered 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
Can you please help me solve this in C language? I did encounter and solve this problem with Java but I cannot seem to implement the use of structures in solving this problem. Help is appreciated, thank you.
Using the concept of structures, write a
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, marking with an ‘X’ the seats already assigned. For example, after seats 1A, 2B, and 4C are taken, the display should look like:
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 |
Seats are assigned by specifying a number and a letter. If the user types in a seat that is already assigned, the program should say that the seat is occupied and ask for another choice. The program should run until all seats are filled, or the user signals that the program should end.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images