Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with six seats in each row. Rows 1 and 2 are first class, rows 3 through 7 are business class, and rows 8 through 13 are economy class. Use two parallel arrays: a one-dimensional array to store the row number of the seats (Row #) a two-dimensional array of 13 rows and 6 columns to store the seat assignments (*) and seat letters (A-F) Your program must prompt the user to enter the following information: Reserve a seat (Yes (Y/y) or No (N/n)) Assign ticket type (first class (F/f), business class (B/b), or economy class (E/e)) Select desired seat (1-13 and A-F) Your program must contain at least the following functions:

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 5GZ
icon
Related questions
Question

Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with six seats in each row. Rows 1 and 2 are first class, rows 3 through 7 are business class, and rows 8 through 13 are economy class.

Use two parallel arrays:

  • a one-dimensional array to store the row number of the seats (Row #)
  • a two-dimensional array of 13 rows and 6 columns to store the seat assignments (*) and seat letters (A-F)

Your program must prompt the user to enter the following information:

  • Reserve a seat (Yes (Y/y) or No (N/n))
  • Assign ticket type (first class (F/f), business class (B/b), or economy class (E/e))
  • Select desired seat (1-13 and A-F)

Your program must contain at least the following functions:

  • a function to initialize the seat plan.
  • a function to show the seat assignments.
  • a function to show the menu to assign a seat.
  • a function to assign and select your desired seat.
  • a function for each ticket type that determines if a seat is occupied and if that class is full .

Output the seating plan in the following form:

            A B C D

Row 1  *  *  X  *

 

Here, * indicates that the seat is available; X indicates that the seat is occupied. Make this a menu-driven program; show the user’s choices and allow the user to make the appropriate choices.

Expert Solution
Step 1

Using C++ Language 

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT