- 分享
- 0
- 人气
- 0
- 主题
- 0
- 帖子
- 4
- UID
- 260033
- 积分
- 4
- 阅读权限
- 10
- 注册时间
- 2009-9-1
- 最后登录
- 2009-10-6
- 在线时间
- 9 小时
|
AIRLINE RESERVATION SYSTEM
A small airline has just purchased a computer for its new automated reservation 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 a 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 the 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 and decision structures 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.
我不知道要从哪里下手!em0034 |
|