Airline Reservation System | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Airline Reservation System

Can Somebody help me to solve this problem. I think we can write a good code together. " (AirlineReservationsSystem) A small airline has just purchased a computer for its new automated reservations system.You’ve been asked to program the new system. You are to write a program to assign seats on each flight of the airline’s only plane (capacity: 10 seats). Your program should display the following menu of alternatives—Please type 1 for "First Class" and Please type 2 for "Economy".If the person types 1,your program should assign a seat in the first class section (seats 1–5).If the person types 2, your program should assign a seat in the economy section (seats 6–10). Your program should print aboarding pass indicating the person’s seat number and whether it’s in the first class or economy section of the plane. Use a one-dimensional array to represent the seating chart of the plane.Initialize all the elements of the array to false to indicate that all seats are empty.As each seat is assigned, set the corresponding elements oft he array to true to indicate that the seat is no longer available. Your program should, of course,never assign a seat that has already been assigned.When the firstclass section is full, your program should ask the person if it’s acceptable to be placed in the economysection (and vice versa).If yes, then make the appropriate seat assignment. If no, then print the message "Next flight leaves in 3hours." "

9th May 2017, 4:18 PM
Mehmet Can Karakaya
Mehmet Can Karakaya - avatar
4 Answers
9th May 2017, 9:57 PM
Rishabh Agrawal
Rishabh Agrawal - avatar
+ 2
ok sorry I don't know in c++ but I can help you for th logic : 1. create an array(here places) of a length of 10 and who are values are 0 (and 1 if there is already somebody) 2. ask the user 3. test if the sum of places is smaller than 10 else affiche : the next fly is in... 4. if the user classes is 1 test if the sum of the first 5 values is <=5 4.1 if no propose to change the classes 4.1.1 if yes read places from the 6 to the 10 values and as from the value is equal to 0 stop and print the number of the place and modify his value to 1 4.1.2 if no print the message next fly... 4.2 if yes do 4.1.1 with the 5 first values 5. if the user class is 2 do the 4 but with the good values if you would like to memorize the array place create a fill or use a loop I hope it is helpful but I don't know c++ so there is probably a faster method... P.S. : sorry for the bad english 😄
9th May 2017, 9:15 PM
Hbeo
Hbeo - avatar
+ 1
no i am studying for the exam on how to program 8 th edition book, these examples are very hard for me
9th May 2017, 7:12 PM
Mehmet Can Karakaya
Mehmet Can Karakaya - avatar
0
it is a homework ?
9th May 2017, 5:47 PM
Hbeo
Hbeo - avatar