Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please please help in this code I need same results in sample run Task-5 Airplane reservation system Saudi airlines need your help in their reservation
please please help in this code I need same results in sample run Task-5 Airplane reservation system Saudi airlines need your help in their reservation system. Write a C++ program that does the following: 1. Allow the user to enter the size of the airplane in terms of rows and columns 2. Create a dynamic 2D array of Boolean type with the specified rows and columns. 3. Display a menu to the user that allows them to choose from the following: a. Reserve a seat void reserve(bool *"arr, int rows, int cols) The user enters the row and column of the seat they would like to reserve. If the seat is available, it is then reserved for the user. If it's not available, a message is displayed to the user conveying that the seat has already been reserved. b. Display the number of available seats int available(bool **arr, int rows, int cols) This function returns the number of available seats that haven't been reserved yet. c. Display all the seats in the airplane void display(bool **arr, int rows, int cols) This function visualizes to the user all the seats in the plane. Reserved seats are displayed " 1 "" and unreserved seats are displayed " 0 ". 4. Continue to allow the user to choose from the menu until the user enters ' y '. 5. Delete the dynamic array when it's no longer used. Sample Run How many rows are in the plane 2 How many seats per row 2 -menu-reserve a seat 2-display the available seats 3-display all the seats in the plane 2 available seats: 4 Would you like to quit?n 1-reserve a seat 2-display the available seats 3-display all the seats in the plane 30000 Would you like to quit?n 1-reserve a seat 2-display the available seats 3-display all the seats in the plane which seat would you like to reserve [row][col]1 1 The seat has been reserved! Would you like to quit?n -menu- 2-display the available seats 3-display all the seats in the plane 1 which seat would you like to reserve [row][coi]0 1 The seat has been reservedl Would you like to quit?n 1-reserve a seat 2-display the avallable seats 3-display all the seats in the plane Would you like to quit?n -menu- 2-display the available seats 3-display all the seats in the plane 1 which seat would you like to reserve [row][col]0 1 Sorry, the seat is already reserved Would you like to quit?n | The seat has been reserved! Would you like to quit?n 1-reserve a seat 2-display the available seats 3-display all the seats in the plane 1 The plane is full Would you like to quit?n 1-menu- 2-display the available seats 3-display all the seats in the plane 3 11 11 Would you like to quit?y
please please help in this code
I need same results in sample run
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started