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:     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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

(Airplane Seating Assignment) | 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:

 

 

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.

A
B
с
D
E
F
Row 1
X
Row 2
X
X
Row 3
X
X
X
Row 4
X
X
Row 5
X
Row 6
X
Row 7
X
X
Row 8
X
X
X
Row 9
X
X
X
Row 10
X
Row 11
X
Row 12
X
Row 13
X
*
*
*
*
Transcribed Image Text:A B с D E F Row 1 X Row 2 X X Row 3 X X X Row 4 X X Row 5 X Row 6 X Row 7 X X Row 8 X X X Row 9 X X X Row 10 X Row 11 X Row 12 X Row 13 X * * * *
Expert Solution
Step 1

Actually, given information:

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)
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 8 images

Blurred answer
Knowledge Booster
Array
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education