大二上数据结构课设-航空客运订票系统c++

AirPassengerBookingSystem

大二上数据结构课设:航空客运订票系统

问题描述

航空客运订票的业务活动包括:查询航线、客票预订和办理退票等。试设计一个航空客运订票系统,以使上述业务可以借助计算机来完成。

基本需求

(1) 每条航线所涉及的信息有:终点站名、航班号、飞机号、飞行周日(星期几)、乘员定额、余票量、已订票的客户名单(包括姓名、订票量、舱位等级 1,2 或 3)以及等候替补的客户名单(包括姓名、所需票量);

(2) 作为示意系统,全部数据可以只放在内存中;

(3) 系统能实现的操作和功能如下:

① 查询航线:根据旅客提出的终点站名输出下列信息:航班号、飞机号、星期几飞行,最近一天航班的日期和余票额;

② 承办订票业务:根据客户提出的要求(航班号、订票数额)查询该航班票额情况,若尚有余票,则为客户办理订票手续,输出座位号;若已满员或余票额少于订票额,则需重新询问客户要求。若需要,可登记排队候补;

③ 承办退票业务:根据客户提供的情况(日期、航班),为客户办理退票手续,然后查询该航班是否有人排队候补,首先询问排在第一的客户,若所退票额能满足他的要求,则为他办理订票手续,否则依次询问其它排队候补的客户。

选做内容

(1) 当客户订票要求不能满足时,系统可向客户提供到达同一目的地的其它航线情况。

(2) 增加管理员模块。包括管理员的验证,查看、增加、删除航班和查看某一航班的客户信息。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
航空客运订票系统设计与实现是一个可以实现航空客运订票的系统。它包括了浏览和查询航班信息、机票预订办理退票主要业务活动。以下是一个使用C++实现的简单示例: ```cpp #include <iostream> #include <string> #include <vector> using namespace std; struct Flight { string start; string destination; string number; string airplaneNumber; string flightDate; int totalSeats; int availableSeats; int firstClassSeats; int businessClassSeats; int economyClassSeats; double firstClassPrice; double businessClassPrice; double economyClassPrice; }; vector<Flight> flights; void addFlight() { Flight flight; cout << "Enter start: "; cin >> flight.start; cout << "Enter destination: "; cin >> flight.destination; cout << "Enter number: "; cin >> flight.number; cout << "Enter airplane number: "; cin >> flight.airplaneNumber; cout << "Enter flight date: "; cin >> flight.flightDate; cout << "Enter total seats: "; cin >> flight.totalSeats; cout << "Enter available seats: "; cin >> flight.availableSeats; cout << "Enter first class seats: "; cin >> flight.firstClassSeats; cout << "Enter business class seats: "; cin >> flight.businessClassSeats; cout << "Enter economy class seats: "; cin >> flight.economyClassSeats; cout << "Enter first class price: "; cin >> flight.firstClassPrice; cout << "Enter business class price: "; cin >> flight.businessClassPrice; cout << "Enter economy class price: "; cin >> flight.economyClassPrice; flights.push_back(flight); cout << "Flight added successfully!" << endl; } void deleteFlight() { string number; cout << "Enter flight number to delete: "; cin >> number; for (int i = 0; i < flights.size(); i++) { if (flights[i].number == number) { flights.erase(flights.begin() + i); cout << "Flight deleted successfully!" << endl; return; } } cout << "Flight not found!" << endl; } void displayFlights() { for (const Flight& flight : flights) { cout << "Start: " << flight.start << endl; cout << "Destination: " << flight.destination << endl; cout << "Number: " << flight.number << endl; cout << "Airplane Number: " << flight.airplaneNumber << endl; cout << "Flight Date: " << flight.flightDate << endl; cout << "Total Seats: " << flight.totalSeats << endl; cout << "Available Seats: " << flight.availableSeats << endl; cout << "First Class Seats: " << flight.firstClassSeats << endl; cout << "Business Class Seats: " << flight.businessClassSeats << endl; cout << "Economy Class Seats: " << flight.economyClassSeats << endl; cout << "First Class Price: " << flight.firstClassPrice << endl; cout << "Business Class Price: " << flight.businessClassPrice << endl; cout << "Economy Class Price: " << flight.economyClassPrice << endl; cout << endl; } } int main() { int choice; do { cout << "1. Add Flight" << endl; cout << "2. Delete Flight" << endl; cout << "3. Display Flights" << endl; cout << "0. Exit" << endl; cout << "Enter your choice: "; cin >> choice; switch (choice) { case 1: addFlight(); break; case 2: deleteFlight(); break; case 3: displayFlights(); break; case 0: cout << "Exiting..." << endl; break; default: cout << "Invalid choice!" << endl; break; } cout << endl; } while (choice != 0); return 0; } ``` 这个示例实现了航空客运订票系统的基本功能,包括添加航班、删除航班和显示航班信息。你可以根据自己的需求进行扩展和修改。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

北航程序员小C

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值