ImageVerifierCode 换一换
格式:DOCX , 页数:13 ,大小:16.29KB ,
资源ID:7043687      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/7043687.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C++版大大数据结构航空订票系统源代码.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C++版大大数据结构航空订票系统源代码.docx

1、C+版大大数据结构航空订票系统源代码#ifndef _FLIGHT_H_#define _FLIGHT_H_#includeusing namespace std;struct node int id; char start20; char over20; float s_time; float o_time; int price; float sale; int ticket; struct node *next;struct people char name20; char passpart20; int ticket; int id; int number; struct people

2、*next;class flypublic: void add(); node* read(); int select(); void update(); void update_ticket(int id,int u_id); ofstream we; ifstream re;private: node *head;class user:public flypublic: int add(); int insert(); void dele(); int user_id;#endif#includeiostream#includeflight.h#includefstreamusing na

3、mespace std;void fly:add() int i; node *p=new node; node *s,*n; head=p; we.open(flight.txt,ios_base:app|ios_base:binary); cout请依次输入航班信息:endl; cout航班号 起飞地 目的地 起飞时间 降落时间 票价 折扣 票数p-idp-startp-overp-s_timep-o_timep-pricep-salep-ticket; while(p!=NULL) cout是否再次输入? 1 是 2 否i; if(i=1) s=new node; cins-ids-st

4、arts-overs-s_times-o_times-prices-sales-ticket; p-next=s; p=s; p-next=NULL; else p-next=NULL; p=p-next; n=head; while(n!=NULL) we.write(reinterpret_cast(n),sizeof(struct node); n=n-next; we.close(); cout录入成功next=NULL; re.read(reinterpret_cast(p),sizeof(struct node); h-next=p; while(!re.eof() s=new n

5、ode; re.read(reinterpret_cast(s),sizeof(struct node); p-next=s; p=s; p-next=NULL; re.close(); return h;int fly:select() node *p,*h; h=read(); p=h-next; int i; cout您是要按 1 航班号 2 抵达城市 3 起飞城市 查找?i; if(i=1) cout请输入航班号i; for(;) if(p-id=i) cout航班号 id 起飞地 start 目的地 over 起飞时间 s_time 降落时间 o_time 票价 price 折扣 s

6、ale 票数 ticketticket; break; if(p-next=NULL) cout查无次航班信息next; i=0; if(i=2) char ove20; cout请输入抵达城市ove; for(;) if(strcmp(p-over,ove)=0) cout航班号 id 起飞地 start 目的地 over 起飞时间 s_time 降落时间 o_time 票价 price 折扣 sale 票数 ticketnext=NULL) break; p=p-next; if(i=3) char sta20; cout请输入起飞城市sta; for(;) if(strcmp(p-sta

7、rt,sta)=0) cout航班号 id 起飞地 start 目的地 over 起飞时间 s_time 降落时间 o_time 票价 price 折扣 sale 票数 ticketnext=NULL) break; p=p-next; void fly:update() int i; node *p,*n,*h; h=read(); p=h-next; cout请输入您要修改的航班信息的航班号i; for(;) if(p-id=i) cout航班号 id 起飞地 start 目的地 over 起飞时间 s_time 降落时间 o_time 票价 price 折扣 sale 票数 ticket

8、endl; cout请输入修改后的航班信息:endl; cout航班号 起飞地 目的地 起飞时间 降落时间 票价 折扣 票数p-idp-startp-overp-s_timep-o_timep-pricep-salep-ticket; break; if(p-next=NULL) cout查无此航班信息next; n=h-next; we.open(flight.txt,ios_base:trunc|ios_base:binary); while(n!=NULL) we.write(reinterpret_cast(n),sizeof(struct node); n=n-next; we.cl

9、ose(); cout修改成功next; for(;) if(p-id=u_id) p-ticket=p-ticket-id; break; if(p-next=NULL) break; p=p-next; n=h-next; we.open(flight.txt,ios_base:trunc|ios_base:binary); while(n!=NULL) we.write(reinterpret_cast(n),sizeof(struct node); n=n-next; we.close();int user:add() people *p=new people; we.open(use

10、r.txt,ios_base:app|ios_base:binary); cout请依次输入订票信息:endl; cout客户姓名 证件号 订票数量 航班号 订单编号p-namep-passpartp-ticketp-idp-number; we.write(reinterpret_cast(p),sizeof(struct people); we.close(); user_id=p-id; cout录入成功ticket;int user:insert() int ticket,id; ticket=select(); if(ticket=-1) cout请再次查询确定航班号endl; el

11、se if(ticket=0) cout该航班无票endl; else id=add(); return id; void user:dele() int num; re.open(user.txt,ios_base:binary|ios_base:in); people *h,*s,*p,*n,*m; h=new people; p=new people; re.read(reinterpret_cast(p),sizeof(struct people); h-next=p; while(!re.eof() s=new people; re.read(reinterpret_cast(s),

12、sizeof(struct people); p-next=s; p=s; p-next=NULL; re.close(); cout请输入您要删除的客户订单编号num; m=h; n=h-next; while(n!=NULL) if(n-number=num) m-next=n-next; p=h-next; we.open(user.txt,ios_base:binary); while(p!=NULL) we.write(reinterpret_cast(p),sizeof(struct people); p=p-next; we.close(); cout删除成功next; m=m-

13、next; #includeiostream#includeflight.h#includefstreamusing namespace std;int main() user a; fly b; int i,s,id; cout 欢迎进入航班订票系统endl; cout请选择:endl; cout1 航班信息管理 2 订票信息管理 3 退出endl; cout请选择您要实施的操作;i; system(CLS); switch(i) case 1: cout1 添加航班信息 2 查找航班信息 3 修改航班信息 4 返回上一层s; system(CLS); switch(s) case 1: b.add(); break; case 2: a.select(); break; case 3: a.update(); break; default: system(CLS); break; case 2: cout1 添加订票信息 2 删除订票信息 3 返回上一层s; system(CLS); switch(s) case 1: id=a.insert(); a.update_ticket(id,a.user_id); break; case 2: a.dele(); break; case 3: break; break; case 3: return 0; break;

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1