Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How to make a C++ project for a flight reservation system? #include Must use a 2D array. a plane journey that travels from Paris to

How to make a C++ project for a flight reservation system?

#include

Must use a 2D array.

a plane journey that travels from Paris to London. Assume the plane consists of (40 seats distributed amongst different classes) with the following specifications:

3 Classes:

First ($400 per ticket)

Business ($300 per ticket)

Economy ($100 per ticket)

10 Rows:

Row 1- 2: First class

Row 3-5: Business class

Row 6-10: Economy class

4 Seats in each row: (A, B, C, and D)

The program should display the seat pattern, with * marking the empty seats and X marking the seats already assigned.

The program starts by displaying the seats available (empty seating chart) along with a brief description and a list of the prices for each class. After displaying the seats available, the program prompts the user to choose the desired class by inserting one of the following: F (first), B (business), or E (economy). After that, the user gets to choose the desired row, based on the class selected. For example, if the user chose first class in the previous step, then the user is limited to choose between row 1 and row 2. Once the user chooses a valid row, he will be prompted to choose a valid seat (A, B, C, or D). Once the reservation is confirmed, the user has the option to view the updated seating chart, book another seat, or end the program (booking session), which displays the bill.

If the user continues with the booking and chooses a seat that is already booked, the program should say that the seat is taken and ask the user to choose another seat.

When the user decides to end the booking session, the bill is generated. This bill explains the number and type of tickets booked and displays the final price for all the purchased tickets. For example, if the user purchased the previously three mentioned tickets (1A, 2C, and 1-D).

Use meaningful identifier names (dont use int x and double y)

Use comments throughout your project and explain the propose of each function

Use functions and minimize the amount of coding in your main function. For example, create the following functions:

Reserve function

Print function

Calculate function

Notice the input validation throughout the project. For example, the program will not allow the user to insert:

Invalid class, only F, B, or E are allowed.

Out of range row. For example, if the class is F (first), the user can only choose row 1 or 2. If the class is B (business), the user can only choose rows between 3 and 5. If the chosen class is E (economy) then the user can only choose a row between 6 and 10.

Out of range seats, only A, B, C, or D are the existing seats. The user cannot choose any other letter.

A seat that is already booked (assigned) cannot be booked again. A user who chose a booked seat will be given the chance to choose a different seat.

Throughout the program, input is not case sensitive. In other words, the user can insert upper case or lower case letters to choose a class, a seat, or to navigate the program menu.

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

LO12.5 Discuss the economic effects of monopoly.

Answered: 1 week ago

Question

LO12.1 List the characteristics of pure monopoly.

Answered: 1 week ago