1. Engineering
  2. Computer Science
  3. for this weeks assignment create and complete a windows...

Question: for this weeks assignment create and complete a windows...

Question details

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 enters 2, your application should assign a seat in the economy class( seats 6-10).

Use a one-dimensional array of 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 program should never assign a seat that has already been assigned. When the economy section is full, your program should ask the user if he would like to be placed in the first class, and vice-versa. If yes, make the appropriate seat assignment. if no, display the message, " Next flight leaves in 3 hours".

Remember to include comments in your code .

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution