-3

Write a program to assign passengers seats in an airplane. Assume a small airplane with seat numberings 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 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
6 A B C D
7 A B C D

After displaying the seats available, the program should prompt for the seat desired, the user can type in a seat, and then the display of available seats should be 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 that seat is occupied and ask for another seat.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Duki
1

First, please use a descriptive title. "Help me" does not qualify!

Second, you posted this only 2 hours before. Did you really expect help in that short of time?

Most importantly, why would we do your assignment if you don't want to. It looks like you have simply copied and pasted what you're supposed to do. What have you tried so far? Are you stuck on a particular part? You need to show us that you have put some serious effort into it first before we help you.

Dave

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.