Answered step by step
Verified Expert Solution
Question
1 Approved Answer
program should ne in c++ Seat Assignment Objective: learn how to: -pass multi-scripted array to a function Problem: Write a program to assign passenger's seats
program should ne in c++
Seat Assignment Objective: learn how to: -pass multi-scripted array to a function Problem: Write a program to assign passenger's seats in an airplane. Assume a small airplane with seat numbering as follows: 1 ABCDEF 2 ABCDEF 3 ABCDEF 4 ABCDEF 5 ABCDEF 6 ABCDEF 7 ABCDEF 8 ABCDEF 9 ABCDEF The program should display the seat pattern, with an "X' marking the seats already assigned. For example, after seats 1 A, 2 B and 4 E are taken, the display should look like this: 1 XBCDEF 2 AXCDEF 3 ABCDEF 4 ABCDXF 5 ABCDEF 6 ABCDEF 7 ABCDEF 8 ABCDEF 9 ABCDEF Define a display function to display the seats table as shown above. After displaying the seats available, the program prompts for the seat desired, the user types in a seat (an integer, a space and a letter) and print a message "the seat is assigned" if the seat is available. If the user types in a seat that is already assigned, the program should display the seat table, say that the seat is occupied, tell the user how many seats left and ask for another try. This continues until all seats are filled with a notice or until the user signals the program should end. Then display the seat table and tell the user how many seats are taken. You need to handle invalid input like 10 B, 4 S, IA. A or A 2. Requirements: You must define a display function to show the table. Hints: The statement index col will assign the integer I to index if the variable col holds value 'B', where index is in data type and represents the position number of the column Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started