The system is designed to implement a flight ticket booking platform with a waiting list feature. The main functionalities include:
-
Search Flights
Users can search for flights in any chosen week and book tickets during that period. For simplicity, all flights operate on the same route without specifying departure or arrival destinations. -
Book Tickets
- If there is a vacant seat, the ticket will be booked, and the passenger will be added to the confirmed tickets list.
- If no seats are available, the passenger will be added to the waiting list.
-
Edit Ticket Information
Users can edit passenger information, such as name and passport number, on the ticket. -
View Ticket Status
Users can check the status of their ticket (confirmed or in the waiting list). -
Cancel Tickets
When a ticket is canceled:- The first passenger in the waiting list will be moved to the confirmed tickets list.
- If no passengers are on the waiting list, the seat becomes vacant.
-
Passenger Class
Stores passenger information (e.g., name, ID, passport number). -
Flight Class
Contains flight details (e.g., flight number, available seats). -
Booking Class
Manages ticket details, such as the seat number and linked user ID. -
AuthService Class
Handles user authentication, registration, and login. -
FlightService Class
Facilitates flight-related operations such as adding, removing, and searching for flights. -
BookingService Class
Manages ticket bookings, cancellations, and updates.
- Confirmed tickets are stored in an array of objects, with each object containing passenger and ticket details.
- The waiting list is implemented using a queue data structure.
-
Mastery of data structures (10%):
Includes the development and proper usage of classes, methods, and constructors. -
Fulfillment of project requirements (15%):
- Searching and traversing data (5%).
- Editing data (adding, deleting, sorting, etc.) (5%).
- Producing correct results (5%).
-
Submission of slides and a 2-minute video presentation (5%).
- Compile and run the
Main Class
. - Follow the instructions on the console to interact with the system.
该系统旨在实现一个包含候补功能的航班票务预订平台。主要功能包括:
-
搜索航班
用户可以选择任意一周搜索航班并预订对应时间段的机票。为简化设计,所有航班均在同一航线飞行,无需输入出发地和目的地。 -
预订机票
- 如果航班有空座位,则直接预订,并将乘客加入确认机票列表。
- 如果无空座位,则将乘客加入候补队列。
-
编辑票务信息
用户可以编辑机票上的乘客信息,例如姓名、护照号码等。 -
查看票务状态
用户可以查询机票状态(已确认或在候补队列中)。 -
取消机票
当机票被取消时:- 候补队列中的第一位乘客将被移动到确认机票列表。
- 如果候补队列为空,座位将变为可用。
-
Passenger类
保存乘客信息(如姓名、ID、护照号码)。 -
Flight类
包含航班详情(如航班号、可用座位数)。 -
Booking类
管理票务信息,例如座位号及关联的用户ID。 -
AuthService类
处理用户的注册、登录和认证。 -
FlightService类
负责航班相关操作,如新增、删除和搜索航班。 -
BookingService类
管理机票预订、取消和更新。
- 确认机票存储在一个对象数组中,每个对象包含乘客和票务信息。
- 候补队列通过队列数据结构实现。
-
数据结构掌握(10%):
包括类、方法和构造函数的正确开发和使用。 -
完成项目需求(15%):
- 数据的搜索与遍历(5%)。
- 数据编辑(增删改等操作)(5%)。
- 结果的正确性(5%)。
-
提交幻灯片及2分钟视频演示(5%)。
- 编译并运行
Main Class
。