Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We are going to write a program that will take reservations for an airplane. The airplane has 78 total seats and has 13 rows or

We are going to write a program that will take reservations for an airplane. The airplane has 78 total seats and has 13 rows or 6 seats per row. Your program should display the seating chart, ask the user to enter the row and seat number they want to reserve and either mark that seat as now reserved or report that the seat is already taken. Here are some hints to help you out: Use a two dimensional array of characters to represent the data. The program should ask if they want to reserve a seat. If they do, then display the seating chart and read in which seat row would like (this would be the row in the array) and then the seat number (the column in the array). It should check if the seat is available and if so, mark it taken and report back that the seat is theirs. If the seat is taken, the program should report that. Either way it should then start over (that is, ask if they want to reserve a seat). There is a lot going on in this program. Dont be overwhelmed! Take it in steps. Set up the array first weather you read it in from a data file or initialize the array in the program. Write a method that displays the array. Youll need a nested loop for this. In the main program set up a loop that continues until the user says they dont want to find a seat (read a while loop). Use a priming read here. Inside the loop, call your display the array method. Ask the user for which row they want to sit in. This will determine your row in the array. For testing purposes, output the row number that corresponds to the seat type. Remember that arrays are zero based so you may be off by one and need to make some adjustments. Then ask for which seat they want. This will determine the column in the array. Be sure they do not pick a seat that would cause an index out of bounds error! You should have at least one method (other than main) one to display the seating chart.

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

Detailed note on the contributions of F.W.Taylor

Answered: 1 week ago

Question

LO4 Identify a system for controlling absenteeism.

Answered: 1 week ago