Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

Under what circumstances do your customers write complaint letters?

Answered: 1 week ago

Question

Perform the following conversion- mg ).31 )olnts eBook

Answered: 1 week ago

Question

1. What might have led to the misinformation?

Answered: 1 week ago

Question

2. How will you handle the situation?

Answered: 1 week ago

Question

3. Write a policy statement to address these issues.

Answered: 1 week ago