By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,991 Members | 1,737 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,991 IT Pros & Developers. It's quick & easy.

Airline reservation system

P: 1

A small airline has just purchased a computer for its new automated reservations system. The president has asked you to program the new system in C. You are to write a program to assign seats on each flight of the airline’s only plane (capacity: 20 seats). Your program should display the following menu alternatives:

Please type 1 for “business”
Please type 2 for “economy”

If the person types 1, then your program should assign a seat in the business class (seats 1-5). If the person types 2, then your program should assign a seat in the economy class (seats 6 – 20). Your program should then print a boarding pass indicating the person’s seat number and whether it is in the business or economy class of the plane. Use single-scripted array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of the array to 1 to indicate that the seat is no longer available. Your program should never assign a seat that has already been assigned. When the business class is full, your program should ask the person if it is acceptable to be placed in the economy class (and vice versa). If yes, then make the appropriate seat assignment. If no, then print the message “Next flight leaves in 3 hours”.

Basic Requirements:

Assign a seat either in the business or economy class.
Display a boarding pass
Display seating chart with indication of assigned or not assigned
Validation – no seat that has been assigned can be re-assigned
Re-assign seat if class is full

You may design the system in any way you feel that meets the system’s requirement. You may include menus that you feel are relevant to navigate around the system. Eventually there should be an end to the system. Use quit to exit the system.

You may use structures, arrays, loops, decision structures and files in your program. You may include any extra features e.g. sorting the boarding passes by name, which you may feel relevant and that adds value to the system.
Sep 2 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 464
you should read the 2 sticky threads at the top.
Sep 2 '07 #2

Expert Mod 5K+
P: 9,197
Please read the posting guidelines.
Sep 3 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.