当前位置: 首页 > news >正文

航空公司管理系统(迷你版12306)

要求

今天分享一个之前辅导留学生的作业,作业要求如下:

Project E: Airways Management System
Overall description:
Your team is employed by an Airways company for the implementation of a computer
system responsible for a large part of the operation of the company.
Customer specifications:
The system must be able to store the information of planes, flights and passengers of
the company during the years of its operation. There are two types of planes P62 &
P124 with rectangular arrangements of 6*2 & 12*4 seats, respectively. The sources
and destinations of the currently available flights of the company (for simplicity,
assume only direct flights) are allocated from a set of city airports which can be
potentially extended. The different passengers can be allocated to specific flights and
seats.
The system should be able to provide functionality to the different users listed below:
1. An administrator who can include new flights, prices, dates, airports and perhaps
new planes for each of the two available types.
2. A ticket agent who can flexibly search for a specific flight inquired by a customer.
When the customer reserves or books a ticket, then the required details must be stored.
Such information includes flight id, payment details, expiration date of reservation,
route, allocated seat, viewing facilities of the seating plan, etc. Facilities to amend this
information must be provided.
3. A manager who can retrieve statistics about the company’s operation, such as the
number of planes for each type, total passengers per flight, total revenue, etc.

功能主要有3个模块:
1.管理员模块,管理员可以管理新航班、价格、日期、机场等。

2.票务代理模块,可以灵活搜索客户查询的航班信息。
这些信息包括航班id、付款详细信息、预订截止日期、,

路线、分配的座位、座位计划的观看设施等。

客户可以进行预定,修改以及退票操作。

3.统计模块:可以检索航空公司运营的统计数据,例如

每种类型的飞机数量、每次航班的乘客总数、总收入等。
 

核心代码

数据结构

struct Plane{string ID;int type;//the type of the plane, 1-P62,2-P124string src;//start citystring dst;//destination citystring time;//time to set outint seatNum;//number of seats in a compartmentint remainTicket;//the remain ticket of a planeint price;//the price of a ticketPlane *next;Plane(){ next = NULL; }
};struct Ticket
{string passengerName;//the passenger namestring  planeID;int price;string expirationDate;//the expiration date of the ticketstring src;//start citystring dst;//destination cityint seatNum; Ticket* next;Ticket(){ next = NULL; }
};struct PlaneHead{Plane *head;int num;
};struct TicketHead{Ticket *head;int num;
};

增加航班

void addNewPlane(PlaneHead *pchead){string ID;Plane *temp;Plane *pc = pchead->head;int loopFlag = 0;cout << "Add a new plane!" << endl;cout << "input the new plane's ID:";cin >> ID;if (searchByPlaneID(pchead, ID) != NULL){cout << "This plane ID is existed! Fail to add a new plane, please retry!" << endl;return;}temp = new Plane;temp->ID = ID;do{cout << "Please input the new plane's type(1 or 2):";cin >> temp->type;loopFlag = 0;if (temp->type != 1 && temp->type != 2){cout << "error type!the type should be either 1 or 2,re-input." << endl;loopFlag = 1;}} while (loopFlag);do{cout << "Please input the new plane's start city:";cin >> temp->src;cout << "Please input the new plane's destination city:";cin >> temp->dst;loopFlag = 0;if (temp->src == temp->dst){cout << "the start city %s and destination %s are the same!,please re-input!" << endl;loopFlag = 1;}} while (loopFlag);cout << "Please input the new plane's start time(eg. 12:00 ):";cin >> temp->time;cout << "Please input the new plane's ticket price:";cin >> temp->price;if (temp->type == P62)temp->seatNum = 6 * 2;elsetemp->seatNum = 12 * 4;temp->remainTicket = temp->seatNum;temp->next = NULL;if (pc == NULL)pchead->head = temp;else{while (pc->next)pc = pc->next;pc->next = temp;}pchead->num++;cout << "Add the new plane successfully!" << endl;
}

修改航班

void changePlaneInfo(PlaneHead *pchead){int loopFlag = 0;string ID;char choose;Plane *pc;cout << "please input the plane's ID you want to change: ";cin >> ID;pc = searchByPlaneID(pchead, ID);if (pc == NULL){cout << "The plane ID is not existed!" << endl;return;}cout << "Tips:  you can only change a plane's ticket price,start time,start city and destination city information!" << endl;do{cout << "The plane " << ID << "'s start city: " << pc->src << " ,you want to change?(y/n) ";cin >> choose;if (choose == 'Y' || choose == 'y'){cout << "Please input the new start city: ";cin >> pc->src;}cout << "The plane " << ID << "'s destination: " << pc->dst << " ,you want to change?(y/n) ";cin >> choose;if (choose == 'Y' || choose == 'y'){cout << "Please input the new destination: ";cin >> pc->dst;}if (pc->src == pc->dst){cout << "the start city and destination are the same!" << endl;loopFlag = 1;}} while (loopFlag);cout << "The plane " << ID << "'s start time: " << pc->time << " ,you want to change?(y/n) ";cin >> choose;if (choose == 'Y' || choose == 'y'){cout << "Please input the new start time: ";cin >> pc->time;}cout << "The plane " << ID << "'s price: " << pc->price << " ,you want to change?(y/n) ";cin >> choose;if (choose == 'Y' || choose == 'y'){cout << "Please input the new price: ";cin >> pc->price;}cout << "change successfully!" << endl;
}

根据航班ID搜索航班

Plane *searchByPlaneID(PlaneHead *pchead, string ID){Plane *pc = pchead->head;while (pc){if (pc->ID == ID)return pc;//find the IDpc = pc->next;}return NULL;
}

由于篇幅有限,此处不在贴代码了。如需要完整代码,可以搜索抖音:天天coding。

私信免费获得完整代码以及技术指导。

功能测试

可以搜索抖音:天天coding,观看完整演示视频。

相关文章:

航空公司管理系统(迷你版12306)

要求 今天分享一个之前辅导留学生的作业&#xff0c;作业要求如下&#xff1a; Project E: Airways Management System Overall description: Your team is employed by an Airways company for the implementation of a computer system responsible for a large part of th…...

嵌入式硬件电路原理图之跟随电路

描述 电压跟随电路 电压跟随器是共集电极电路&#xff0c;信号从基极输入&#xff0c;射极输出&#xff0c;故又称射极输出器。基极电压与集电极电压相位相同&#xff0c;即输入电压与输出电压同相。这一电路的主要特点是&#xff1a;高输入电阻、低输出电阻、电压增益近似为…...

学习录

概述 这几年在迷茫中看了不少资料&#xff0c;有觉得写得很棒的&#xff0c;也有写的很糟糕的。所以一直想写这块的总结来进行归纳&#xff0c;同时也希望能给其他处于迷茫中的朋友提供一份高质量的资料列表(也许一个读者也没有)&#xff0c;以下清单个人觉得值得反复看以及思…...

MongoDB索引详解

概述 索引是一种用来快速查询数据的数据结构。BTree 就是一种常用的数据库索引数据结构&#xff0c;MongoDB 采用 BTree 做索引&#xff0c;索引创建 colletions 上。MongoDB 不使用索引的查询&#xff0c;先扫描所有的文档&#xff0c;再匹配符合条件的文档。使用索引的查询&…...

一文搞定JVM内存模型

鲁大猿&#xff0c;寻精品资料&#xff0c;帮你构建Java全栈知识体系 www.jiagoujishu.cn 运行时数据区 内存是非常重要的系统资源&#xff0c;是硬盘和 CPU 的中间仓库及桥梁&#xff0c;承载着操作系统和应用程序的实时运行。JVM 内存布局规定了 Java 在运行过程中内存申请、…...

月报总结|Moonbeam 12月份大事一览

一转眼已经到年底啦。本月&#xff0c;Moonbeam基金会发布四个最新战略重点&#xff1a;跨链解决方案、游戏、真实世界资产&#xff08;RWA&#xff09;、新兴市场。其中在新兴市场方面&#xff0c;紧锣密鼓地推出与巴西公司Grupo RO的战略合作。 用户教育方面&#xff0c;为了…...

现有网络模型的使用及修改(VGG16为例)

VGG16 修改默认路径 import os os.environ[TORCH_HOME] rD:\Pytorch\pythonProject\vgg16 # 下载位置太大了&#xff08;140多G&#xff09;不提供直接下载 train_set torchvision.datasets.ImageNet(root./data_image_net, splittrain, downloadTrue, transformtorchvis…...

MacOS M1/M2 Go Debug 配置

前言 换电脑&#xff0c;Go 环境带来一些麻烦&#xff0c;耽误很多时间&#xff0c;稍作记录。 原始电脑是 Mac 旧款&#xff0c;CPU x86 构型&#xff0c;新电脑 M2&#xff0c;因为旧电脑里本地文件很多&#xff0c;为了简化搬迁&#xff0c;还是用了 Mac 自带的迁移&#x…...

paddlehub 文本检测使用

PaddleHub负责模型的管理、获取和预训练模型的使用。 参考&#xff1a;https://github.com/PaddlePaddle/PaddleHub/tree/develop/modules/image/text_recognition/chinese_text_detection_db_server import paddlehub as hub import cv2 # from utils import cv_show import…...

负载均衡概述

负载均衡 负载均衡 建立在现有网络结构之上&#xff0c;它提供了一种廉价有效透明的方法扩展网络设备和服务器的带宽、增加吞吐量、加强网络数据处理能力、提高网络的灵活性和可用性。 四层负载均衡 vs 七层负载均衡 四层负载均衡&#xff08;目标地址和端口交换&#xff09;…...

C# WinForm MessageBox自定义按键文本 COM组件版

c# 更改弹窗MessageBox按钮文字_c# messagebox.show 字体-CSDN博客 需要用到大佬上传到百度云盘的Hook类&#xff0c;在大佬给的例子的基础上改动了点。 应用时自己加GUID和ProgID。 组件实现&#xff1a; using System; using System.Collections.Generic; using System.L…...

基于SpringBoot微信小程序的宠物美容预约系统设计与实现

博主介绍&#xff1a;✌全网粉丝30W,csdn特邀作者、博客专家、CSDN新星计划导师、Java领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和学生毕业项目实战,高校老师/讲师/同行交流合作✌ 主要内容&#xff1a;SpringBoot、Vue、SSM、HLM…...

在 docker 容器中配置双网卡,解决通讯的问题

目录 1. 查看当前网络信息 2. 创建自定义网络桥 3. 创建双网卡模式 4. 删除默认网卡 已经创建好了的 Docker 容器&#xff0c;要修改它的IP比较麻烦&#xff0c;网上找了几种不同的方法&#xff0c;经过试验都没有成功&#xff0c;下面通过配置双网上来解决 IP 的问题。…...

uniapp中uview组件库CircleProgress 圆形进度条丰富的使用方法

目录 #内部实现 #平台差异说明 #基本使用 #设置圆环的动画时间 #API #Props 展示操作或任务的当前进度&#xff0c;比如上传文件&#xff0c;是一个圆形的进度环。 #内部实现 组件内部通过canvas实现&#xff0c;有更好的性能和通用性。 #平台差异说明 AppH5微信小程…...

Linux操作系统基础(12):Linux的Shell解释器

1. Shell的介绍 在Linux中&#xff0c;Shell 是一种命令行解释器&#xff0c;它是用户与操作系统内核之间的接口&#xff0c;它负责解释用户输入的命令&#xff0c;并将其转换成系统调用或其他操作系统能够执行的指令。 Shell 提供了一种交互式的方式来与操作系统进行通信&am…...

Android开发编程从入门到精通,安卓技术从初级到高级全套教学

一、教程描述 本套教程基于JDK1.8版本&#xff0c;教学内容主要有&#xff0c;1、环境搭建&#xff0c;UI布局&#xff0c;基础UI组件&#xff0c;高级UI组件&#xff0c;通知&#xff0c;自定义组件&#xff0c;样式主题&#xff1b;2、四大组件&#xff0c;Intent&#xff0…...

HackTheBox - Medium - Linux - BroScience

BroScience BroScience 是一款中等难度的 Linux 机器&#xff0c;其特点是 Web 应用程序容易受到“LFI”的攻击。通过读取目标上的任意文件的能力&#xff0c;攻击者可以深入了解帐户激活码的生成方式&#xff0c;从而能够创建一组可能有效的令牌来激活新创建的帐户。登录后&a…...

`nginx/conf/nginx.conf`最简配置说明

nginx/conf/nginx.conf最简配置说明 代码 nginx/conf/nginx.conf worker_processes 1; #工作进程个数;一般对应CPU内核对应一个worker_processes;太多反而让效率变差;# 事件驱动模块; events {worker_connections 1024;#设置每个worker_processes对应多少个联接; }# 网络请…...

商务智能|描述性统计分析与数据可视化

一、商务智能的三大方面 三个主要方面是描述性的统计分析、预测性的分析和指导性的数据分析。 A. 商务智能的知识体系下,数据分析包含了哪三个工作?商务智能体系架构里边关于数据分析的术语是什么? 商务智能的知识体系下,数据分析包含了三个工作,即描述性分析,预测性分析…...

【游记】GDKOI2024

去年稳定 Cu&#xff0c;希望今年来块 Ag。 Day − ∞ -\infty −∞ 不知道什么时候报名交钱的&#xff0c;赶紧问一问。 周四把设备送过来了。最近备战期末 选科 演讲比赛&#xff0c;有点忙不过来。 Day0 下午两点半出发&#xff0c;车程 2h。路上给小绿打肉鸽 1h 掉电…...

linux支持的零拷贝类型以及java对应的支持

在之前整理的零拷贝文章基础上 https://blog.csdn.net/zlpzlpzyd/article/details/135321197 https://blog.csdn.net/zlpzlpzyd/article/details/135317834 得出如下 因为开发的程序很多运行在 linux 操作系统上&#xff0c;所以用 linux 进行讲解 linux 调用方式 dma复制次数…...

【TypeScript】声明文件

一、定义 TypeScript 的声明文件包含 .d.ts 扩展名&#xff0c;并用于为 TypeScript 提供关于 JavaScript 代码的类型信息这些文件通常定义了接口、类型别名、类等&#xff0c;但并不包含实际的执行代码当你使用 JavaScript 库或框架时&#xff0c;声明文件就显得非常有用&…...

基于Flutter构建小型新闻App

目录 1. 概述 1.1 功能概述 1.2 技术准备 1.3 源码地址 2. App首页 2.1 pubspec依赖 2.2 热门首页组件 2.2.1 DefaultTabController 2.2.2 Swiper 2.3 新闻API数据访问 2.4 热门首页效果图 3. 新闻分类 3.1 GestureDetector 3.2 新闻分类效果图 4. 收藏功能 4…...

利用python将excel文件转成txt文件,再将txt文件上传hdfs,最后传入hive中

将excel文件转成txt文件&#xff0c;再将txt文件上传hdfs&#xff0c;最后传入hive中 注意的点 &#xff08;1&#xff09;先判断写入的txt文件是否存在&#xff0c;如果不存在就需要创建路径 &#xff08;2&#xff09;如果txt文件已经存在&#xff0c;那么先将对应的文件进行…...

【自学笔记】01Java基础-07面向对象基础-02继承

记录学习Java基础中有关继承、方法重写、构造器调用的基础知识&#xff0c;学习继承之前建议学习static关键字的内容【自学笔记】01Java基础-09Java关键字详解 1 继承概述 1.1 什么是继承&#xff1f; 1.2 继承的特点 子类可以继承父类的属性和行为&#xff0c;但是子类不能…...

二分查找(一)

算法原理 原理&#xff1a;当一个序列有“二段性”的时候&#xff0c;就可以使用二分查找算法。 适用范围&#xff1a;根据规律找一个点&#xff0c;能将这个数组分成两部分&#xff0c;根据规律能有选择性的舍去一部分&#xff0c;进而在另一个部分继续查找。 除了最普通的…...

【华为OD真题 Python】精准核酸检测

文章目录 题目描述输入描述输出描述示例1输入输出说明备注代码实现题目描述 为了达到新冠疫情精准防控的需要,为了避免全员核酸检测带来的浪费,需要精准圈定可能被感染的人群。 现在根据传染病流调以及大数据分析,得到了每个人之间在时间、空间上是否存在轨迹的交叉。 现…...

Springboot使用logback

文章目录 目录 文章目录 前言 一、添加依赖 二、使用步骤 三 、测试使用 总结 前言 Logback 是log4j 框架的作者开发的新一代日志框架&#xff0c;它效率更高、能够适应诸多的运行环境&#xff0c;同时天然支持 SLF4J。 Logback 的定制性更加灵活&#xff0c;同时也是 Sprin…...

【REST2SQL】03 GO读取JSON文件

REST2SQL需要一些配置信息&#xff0c;用JSON文件保存&#xff0c;比如config.json 1 创建config.json配置文件 {"hostPort":"localhost:5217","connString":"oracle://blma:5217127.0.0.1:1521/CQYH","_oracle":"ora…...

数据库-MySQL 启动方式

以管理员身份运行命令行 或者Shell net start //查看所有服务 net start MYSQL80 //启动服务 net stop MYSQL80 //停止服务完整安装MySQL社区版本的 会有这个 启动服务 停止服务 重启服务...

怎样做月嫂网站/重庆关键词排名推广

哈夫曼树(一)定义带权路径长度WPL&#xff1a;哈夫曼树(最优二叉树)&#xff1a;WPL最小的二叉树(二)构造将权值从小到大排序&#xff0c;后将权值最小的两个并在一起成新的二叉树A5,E10,B15,D30,C40(三)哈夫曼树特点1.没有度为1的结点2.n个叶子节点的哈夫曼树共有2n-1个结点树…...

wordpress 流程/找资源

我在编写PHP时遇到麻烦.我有一个JavaScript / jQuery HTML5页面使用$.post与我的PHP脚本交互.但是,PHP面临着一个奇怪的问题,可能与编码有关.当我写作htmlentities("")我希望PHP输出& iacute;.然而,它输出& Atilde;& shy;一开始,我认为我在编码方面犯了一…...

wordpress javascript/自媒体平台排名前十

1.shell简介Shell本身是一个用C语言编写的程序&#xff0c;它是用户使用Linux的桥梁。Shell既是一种命令语言&#xff0c;又是一种程序设计语言。作为命令语言&#xff0c;它交互式地解释和执行用户输入的命令&#xff1b;作为程序设计语言&#xff0c;它定义了各种变量和参数&…...

网站微信支付申请流程/体验式营销

使用命令 &#xff1a;route route 命令 显示和设置Linux路由表 -A&#xff1a;设置地址类型&#xff1b; -C&#xff1a;打印将Linux核心的路由缓存&#xff1b; -v&#xff1a;详细信息模式&#xff1b; -n&#xff1a;不执行DNS反向查找&#xff0c;直接显示数字形式的I…...

网站论坛怎么做/网络营销运营公司

上节内容我们学习了添加食品记录内容&#xff0c;今天我来看一下如何调用第三方的接口功能。浏览器请求本项目案例中的获取店铺列表功能&#xff0c;以及添加商户记录&#xff0c;需要填写店铺地址。在输入店铺地址时&#xff0c;我们需要实时的检测用户关键词输入&#xff0c;…...

网站建设绩效目标/打开网站搜索

这些素材能用于各种设计软件&#xff0c;比如3Dmax,sketchup等各种建模软件以及各种渲染器。 HDR贴图下载地址&#xff1a;https://hdrihaven.com/hdris/category/?call HDR贴图可以选择1k/2k/4k/8k/16k等不同尺寸的素材进行下载 PBR贴图下载地址&#xff1a;https://textu…...