Question

Programming language C++. (Airline Reservations System) A small airline has just purchased a computer for its...

Programming language C++. (Airline Reservations System) A small airline has just purchased a computer for its new au- tomated reservations system. You have been asked to develop the new system. You’re to write an app to assign seats on each flight of the airline’s only plane (capacity: 10 seats).

Display the following alternatives: Please type 1 for First Class and Please type 2 for Economy. If the user types 1, your app should assign a seat in the first-class section (seats 1–5). If the user types 2, your app should assign a seat in the economy section (seats 6–10).

Use a one-dimensional array of type bool to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. As each seat is assigned, set the corresponding element of the array to true to indicate that the seat is no longer available.

Your app should never assign a seat that has already been assigned. When the economy section is full, your app should ask the person if it’s acceptable to be placed in the first-class section (and vice versa). If yes, make the appropriate seat assignment. If no, display the message "Next flight leaves in 3 hours."
1 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1

//Simple application of Air Line Reservation System import java.uti. class AirLine Reservation boolean seat chartI; IAn arraySystem out println( First-Class status chart n) System out println(Seat no.lt Available(true/false)n) forint i-0i<5i++) Sywhile(choice!=3) /Repeat until false System out println(Enter your reservation choice(1-for Economy,2-for First class an 3-felse if(choice=-3) /choice 3 for exit Svstem exit(0); else System out.println(nInvalid choice ); Invalid choice error ar.sho

Add a comment
Answer #2

#include 

#include 

using namespace std; 

void printSeats(int[]); 

int main() { 

  int seats[11] = {0}; 

  int input; 

  int side = 6,centre=1; 

  int passenger=0; 

  char answer='Y'/'N'; 

  while(passenger < 10) { 

    cout<<"Please type 1 for 'side'\n" <<"Please type 2 for 'center'\n" <<"Your Choice "; 

    cin>>input;   

    if (input == 1 || input == 2){ 

      if(seats[0]==1 && seats[1]==1 && seats[2]==1 && seats[3]==1 && seats[4]==1 && seats[5]==1 && seats[6]==1&& seats[7]==1 && seats[8]==1 && seats[9]==1) 

        cout<<"This Flight is FULL!" <<"The Next Flight leaves in 3 hours\n\n";  

    }   

    if (input == 1 ){  

      if (side<=10){ 

        cout<<"\nYou Have Chosen side seats "<<side<<endl; 

        seats[side++]; 

        ++passenger; }  

      if(side>10)  

        cout<<"\nThe Side Seats is Full "<<endl;    

    }   

    if(input == 2 ){  

      if(centre<=5) 

        cout<<"\nYou Have Chosen centre seats "<<centre<<endl; 

      seats[centre++]; 

      ++passenger;  

      if(centre> 5)  

        cout<<"\nThe Centre Seats is Full"<<endl;  

    }  

  }     

  system("pause");  

  return 0;   

}


source: I'm studying inUST
answered by: غيلان اليماني
Add a comment
Know the answer?
Add Answer to:
Programming language C++. (Airline Reservations System) A small airline has just purchased a computer for its...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (Airline Reservations System) A small airline has just purchased a computer for its new automated reservations system

    (Airline Reservations System) A small airline has just purchased a computer for its new automated reservations system. The president has asked you to program the new system. You'll write a program to assign seats on each flight of the airline's only plane (capacity: 10 scats).Your program should display the following menu of alternatives:Please type 1 for "first class"please type 2 for "economy"If the person types 1 , then your program should assign a seat in the first class section (seats...

  • C# Question. Please do a lot of documenting of what your code did and thorough explaining...

    C# Question. Please do a lot of documenting of what your code did and thorough explaining in your // comments. A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You’re to write an app to assign seats on each flight of the airline’s only plane (capacity: 10 seats). Display the following alternatives: Please enter 1 for First Class or 2 for Economy. If the user types...

  • I could really use some help with this question! Thanks!! Must use C# and it must...

    I could really use some help with this question! Thanks!! Must use C# and it must be a console application ------------------------------------------------------------------------------------------------------------------------------ You start working on this w/o arrays just with seats: bool f1, f2,..., e1, e2,.... You can use Console application for now. A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You’re to write an app to assign seats on each flight of the airline’s...

  • A small airline has just purchased a computer for its new automated reservations system

    OBJECTIVE:The objective of the assignment is to use object-oriented design techniques to design an application.DESCRIPTION:A small airline has just purchased a computer for its new automated reservations system. You have been hired to design an airline seating application for the FBN (Fly-By-Night) Airlines. In this portion of the assignment, the task is to do the object oriented design for the application. This system will be used only by the company and its employees. Customers will not interact with the system.Your...

  • For this week's assignment , create and complete a Windows application for the following question. Airline...

    For this week's assignment , create and complete a Windows application for the following question. Airline Reservation System: An airline has just bought a computer for its new reservation system. Develop a new system to assign seats on the new airplane( capacity: 10 seats) Display the following alternatives: "Please type 1 for first class, and please type 2 for Economy". If the user enters 1, your application should assign a seat in the first class( seats 1-5). If the user...

  • C# WINDOWS FORMS APPLICATION (not CONSOLE APPLICATION ) (Please screenshot window form of this program and...

    C# WINDOWS FORMS APPLICATION (not CONSOLE APPLICATION ) (Please screenshot window form of this program and write code on computer. Thank you very much !) For this week's assignment , create and complete a Windows application for the following question. Airline Reservation System: An airline has just bought a computer for its new reservation system. Develop a new system to assign seats on the new airplane( capacity: 10 seats) Display the following alternatives: "Please type 1 for first class, and...

  • I have to write a C program to assign seats on each flight of the airline’s...

    I have to write a C program to assign seats on each flight of the airline’s only plane (capacity: 40 seats, in 10 rows). For the sake of simplicity, assume that each row has 4 seats labeled A, B, C, D. Your program should display the following menu of alternatives: Please type 1 for "first class" Please type 2 for "business class" Please type 3 for “economy class”. If the person types 1, then your program should assign a seat...

  • Write a program in C to assign seats of a movie theater (capacity: 200 seats). Your...

    Write a program in C to assign seats of a movie theater (capacity: 200 seats). Your program should display the following menu of alternatives: Please type 1 for "section A, $50/ticket" type 2 for "section B, $70/ticket", and type 3 for "section C, $80/ticket".  If the user types 1, then your program should assign a seat in the A section (seats 1–50). If the user types 2, then your program should assign a seat in the B section (seats 51–100). If...

  • Programming Language: C++ Develop a seat reservation system for your airline. Consider the following airline seating...

    Programming Language: C++ Develop a seat reservation system for your airline. Consider the following airline seating pattern: A         1          2          3          4          5          6          7          8          9          ……    100 B         1          2          3          4          5          6          7          8          9          ……    100 AISLE C         1          2          3          4          5          6          7          8          9          ……    100 D         1          2          3          4          5          6          7          8          9          ……    100 Either use 2D STL array (array that contains array) or 4 single dimensional STL arrays of size 100. Write a program to display a menu to the user with the options to reserve a seat of choice, reserve a window seat, reserve an aile seat, reserve a seat (any available), withdraw reservation, update reservation (change seat) and display...

  • The Course Project can be started in Week 7 and is due by 11:59 pm CT...

    The Course Project can be started in Week 7 and is due by 11:59 pm CT Saturday of Week 8. It must follow standard code formatting and have a comment block at the top of the code file with a detailed description of what the program does. Functions must have a comment block with a detailed description of what it does. Pseudocode must be provided in the comment block at the top of the file. This program will allow the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT