Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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. Your program must prompt the user to enter the following information:

a) Ticket type (first class, business class, or economy class)

b) Desired seat

c) The seat prices should be read in from the SeatPrices.dat file. This file contains 13 pieces of data representing the price for each row. All seats in a given row are the same price, but different rows have different prices. The seat availability information should be read in from the SeatAvailability.dat file.

Output the seating plan in the following form: image text in transcribed

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

The client program should be a menu-driven program that provides the user with a menu of box office options, accepts and validates user inputs, and calls appropriate functions to carry out desired tasks. The menu should include options to display the seating chart, to request tickets, to print the sales report, and to exit the program.

When the user selects the display seats menu option, a function should be called that displays a chart, similar to the one shown on the following page. It should indicate which seats are already sold (X) and which are still available for purchase (*).

When the user selects the request tickets menu option, the program should prompt for the number of seats the patron wants, the desired row number, and the desired starting seat number. A ticket request function should then be called and passed this information so that it can handle the ticket request. If any of the requested seats do not exist, or are not available, an appropriate message should be displayed. If the seats exist and are available, a bill should be printed that lists the number of requested seats, the price per seat in the requested row, and the total price for the seats. Then the user program should ask if the patron wishes to purchase these seats.

If the patron indicates they do want to buy the requested seats, a purchase tickets function should be called to handle the actual sale. This function must be able to accept money, ensure that it is sufficient to continue with the sale, print a ticket for each seat sold (with the correct row, seat number, and price on it), mark the seat as sold, and give the patron any change due.

When the user selects the sales report menu option, a report function should be called. This function must display a report that tells how many seats have been sold, how many are still available, and how much money has been collected so far for the sold seats. Think about how your team will either calculate or collect and store this information so that it will be available when it is needed for the report.

When the day of ticket sales is over and the quit menu choice is selected, the program needs to be able to write the updated seat availability data back out to the file.

A B D E F x * X X x x > > > >* x * x X Row 1 Row 2 Row 3 Row 4 Row 5 Row 6 Row 7 Row 8 Row 9 Row 10 Row 11 Row 12 Row 13 X + X X X X X* X X

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_2

Step: 3

blur-text-image_3

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

What are the logistics implications of internationalisation?

Answered: 1 week ago