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

开通VIP
 

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

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

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(数据结构航空客运订票系统.doc)为本站上传会员【快乐****生活】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

数据结构航空客运订票系统.doc

1、航空客运订票系统 程序要求: 1、 问题描述 航空客运订票得业务活动包括:查询航线、客票预订与办理退票等。设计一个航空客运订票系统,以使上述业务可以借助计算机完成。 2、 要求 1) 每条航线所涉及得信息有:终点站名、航班号、飞机号、飞行周日(星期几)、乘员定额、余票量、已订票得客户名单(包括名字、订票量、舱位等级1、2、3)以及等候替补得客户名单; 2) 系统实现得功能如下: 通过此系统可以实现如下功能: 录入:可以录入航班情况(数据可以存储在一个数据文件中,数据结构、具体数据自定) 查询:可以查询某个航线得情况(如,输入航班号,查询起降时间,起飞抵达城市,航班票价,票价折

2、扣,确定航班就是否满仓);可以输入起飞抵达城市,查询飞机航班情况; 订票:(订票情况可以存在一个数据文件中,结构自己设定)可以订票,如果该航班已经无票,可以提供相关可选择航班; 退票: 可退票,退票后修改相关数据文件;客户资料有姓名,证件号,订票数量及航班情况,订单要有编号。 修改航班信息:当航班信息改变可以修改航班数据文件 存储结构:航线得所有信息存储在一个结构体中,增加,查询,订票,退票等操作按队列得操作来实现。 程序流程图: Switch(1) 录入功能 请按次序输入航班号,飞机号,终点站,飞行日期,乘客总数,余票数等信息

3、 查询功能 通过目得地查询 Switch(1) 请输入要查询得目得地 Switch(2) 请输入要查询得航班号 通过航班号查询 Switch(2) Switch(3) 订票功能 请输入您需要得订票数 订票成功 订票数<余票数 输入您定得票数 输入您得名字 退票功能 Switch(4) 订票数<余票数 退票成功 Switch(5) 退出系统 详细代码: #include 〈iostream、h> #include #include <string、h> #in

4、clude

5、 wait *next,*pre; }; struct piao {   int seat[n+1]; }; void makenull();   void makenull_piao(); void makenull_information(); void list_menu(); void list_piao(); void makenull_wait(); void list_information(); void plane_information(node *head); void book(); void add_information

6、node *head,int x,int y); void add_wait(int x,int y); void search_delete(int x); void write_to_file(); void show_wait(); bool p(node *x,node*y); node *head1,*head2,*head3,*q; wait *wait_head,*wait_end; char c; piao a[m]; void main() { makenull(); do   {   list_menu();  

7、cout〈

8、     case '4’ : list_information();break;  case ’5’ : search_delete(0);break;       default : break;    } }while(c!='6’);    cout<〈"Exit System "; } void makenull() {  makenull_piao();   makenull_information(); makenull_wait(); } void list_menu()

9、 {   cout〈

10、out<<endl<<”  * 4 、 查瞧飞机信息 *”;   cout<<endl〈〈"     * 5 、 查瞧乘客信息 *";   cout<〈endl〈<"   * 6 、 退出      *"; cout〈〈endl〈<"  ************************"; cout〈<endl<<”"; } void makenull_piao() { FILE *fp; int i;     if((fp=fopen(”piao、dat","r")) == NULL )

11、   {   fp=fopen("piao、dat”,”w");     for (i=1;i<=m-1;i++)       fwrite(&a[i],sizeof(piao),1,fp);       fclose(fp);    fp=fopen("piao、dat”,"r”);   }   for(i=1;i〈=m—1;i++)   fread(&a[i],sizeof(piao),1,fp); fclose(fp); } void makenull_information() {

12、    node *r;   FILE *fp; int i,j,sum; sum=a[1]、seat[0]+a[2]、seat[0]+a[3]、seat[0]; fp=fopen("information、dat”,"r”);    head1=new node;    head2=new node; head3=new node;   head1—〉pre=NULL; head1—>next=NULL; head2->pre=NULL;    head2—〉next=NULL;    head3—>pre=NULL;

13、   head3->next=NULL;   q=head1;   for(i=1;i<=sum;i++) { j=0;     r=new node;    fread(r,sizeof(node),1,fp);   q—>next=r;     r—〉pre=q; r->next=NULL; q=q->next;  fclose(fp);       if(i==a[1]、seat[0]+1) { head2->ne

14、xt=q;       q—〉pre—>next=NULL; q—>pre=head2;   } if(i==a[1]、seat[0]+a[2]、seat[0]+1) {        head3—>next=q;        q—>pre-〉next=NULL; q—>pre=head3;     }   } } void makenull_wait() { wait *tempw;   FILE *fp;    tempw=n

15、ew wait; int i;    if((fp=fopen(”wait、txt",”r”)) ==NULL ) {      fp=fopen("wait、txt","w");      fclose(fp);    } wait_end=new wait; wait_head=new wait;    wait_end->next=NULL;   wait_end—〉pre=NULL;   wait_head=wait_end;     wait_head-〉count=0;   fp=fopen("

16、wait、txt","r”); fread(wait_head,sizeof(wait),1,fp);          for(i=1;i〈=wait_head->count;i++)       {        fread(tempw,sizeof(wait),1,fp);       wait_end-〉next=tempw;     tempw->pre=wait_end;         tempw->next=NULL;            

17、wait_end=tempw;   } } void list_piao() {   int i,j;  for(i=1;i<=m-1;i++)     {     if(a[i]、seat[0]!=n)   {          cout<<endl<<"第 ”<〈i<〈" 架飞机剩余得票 :"<〈endl;     for(j=1;j〈=n;j++)            if (a[i]、seat[j]==0) cout<〈” "<〈j;          cout〈

18、dl;     }       else cout<<endl<〈"The "<<i<〈” plane is full !"〈〈endl<x;cout<〈endl;}while(x〈1 || x〉=m);   cout<〈endl<〈"第 "<〈x〈<" 架飞机得信息如下 "〈<endl;     if(x==1) plane_information(head1);  

19、 if(x==2) plane_information(head2);   if(x==3) plane_information(head3); } void plane_information(node *head) { node *q;     char ch; int x=0;    if(head!=NULL && head->next!=NULL)        q=head-〉next; else {         q=NULL;      cout<<”飞机空,无预订票 !”〈

20、 while(q!=NULL)   {    cout〈<endl〈〈”*******************”〈<endl;     q->date=q—〉plane;        cout〈<”日期 :"<name;    cout<<endl〈〈”ID 号 : "<<q-〉id;      q=q—>next;x++;     if (x % 3 ==0) 

21、ch=getch(); } cout<〈endl; } void book() {     int i,j,p;   cout〈〈endl<<"请选择地点:(1、2、3) "; do {     cin>〉i;       if (i〈1 || i>=m) {      cout〈<endl<〈"**** 超出范围!****"<

22、      cout<j;       if (j〈1 || j>n) {          cout<〈e

23、ndl<<"**** 超出范围!****"<〈endl<<"请重新输入:"; }      else       {        q—〉date=i;      cout<date〈〈endl;       break;   } }while(1); if (a[i]、seat[j]==0) {        a[i]、seat[j]=1;   cout<〈endl;   a[i]、seat[0]++;  

24、if(i==1) add_information(head1,1,j);   if(i==2) add_information(head2,2,j);    if(i==3) add_information(head3,3,j);   }   else   { cout〈<endl<〈"**** 对不起,该座位已被预订,您被安排到订票等候队列 ****”<

25、w=new wait;  tempw->next=NULL; cout〈<"请输入个人信息"<<endl;   cout〈<endl<<"*************"<<endl;   cout<〈"姓名 : ”;cin〉〉tempw-〉name; cout<〈"ID号 : ";cin>>tempw—>id; cout<〈"电话 :";cin>>tempw->phone; tempw->seat=y;   tempw—>plane=x;   wait_end—>next=tempw; tempw->pre=wai

26、t_end;   wait_end=wait_end->next; cout〈

27、e<<” — "; tempw=tempw—>next;  } } void add_information(node *head,int x,int y) { node *temp;    temp=new node; temp—>pre=NULL; temp-〉next=NULL; cout〈〈”请输入个人信息"〈<endl; cout〈〈endl<<”*************”<<endl;  cout〈<"姓名 : ";cin>>temp->name;   cout<<"ID号 : ";cin

28、>〉temp->id;   temp—〉seat=y; temp->plane=x; temp->next=head->next;    temp->pre=head;    if (head->next!=NULL) head—>next->pre=temp;   head->next=temp;   write_to_file(); cout<

29、mpw,*tempw2,*tempw3; int step=1,t1,t2,i;  char ch;   p=new node;  tempw=new wait;   tempw2=new wait;   tempw3=new wait;  q=head1;   cout<<endl〈<”请输入个人信息”〈name;  do{        q=q->next;  

30、 if ( (q!=NULL) &&       (p(q,p)) )   {    cout<〈endl;   q->date=q—>plane;  cout〈〈"Located!"〈<endl;       cout<<”****************”;        cout<<endl<〈"姓名 : ”<<q—〉name;     cout<

31、号 : "〈seat;         cout<<endl<<"班机号 : "<<q—>plane;       cout<>ch;         if (ch=='Y' || ch=='y') {            t1=q—>plane;    

32、t2=q->seat;            a[t1]、seat[t2]=0;   a[t1]、seat[0]-—;                r=q;q=q—>pre;           r-〉pre—>next=r-〉next;       if(r—〉next!=NULL) r—>next-〉pre=r->pre;     delete(r);     cout〈〈"**** 记录删除成功 !

33、 ****";      write_to_file();  tempw=wait_head;             for(i=0;i<wait_head-〉count;i++)        {             tempw=tempw—>next;        if(tempw==NULL) break;         if((tempw-〉plane==t1) &

34、& (tempw—>seat==t2))        {                  strcpy(tempw3—>name,tempw—〉name);                strcpy(tempw3->phone,tempw-〉phone);            cout〈

35、e;            cout〈<endl<<"ID号 : ”<〈tempw-〉id<<endl;              a[t1]、seat[0]++;       a[t1]、seat[t2]=1;           if(tempw->plane==1) add_information(head1,1,tempw-〉seat);              if(tempw->plane==2)

36、add_information(head2,2,tempw->seat);       if(tempw->plane==3) add_information(head3,3,tempw->seat);             tempw2=tempw—〉pre;        tempw2—>next=tempw->next;                    if(tempw—>next==NULL) wait_end=tempw2;

37、           else  tempw—>next->pre=tempw2;             delete(tempw);                   wait_head—>count-—;          write_to_file();                     cout〈phone<<”通知了”〈

38、          break;           }              }       }        }continue;   }     else     {   if (q==NULL)    {  step++;      if(step==2) q=head2;       if(step==3)

39、 q=head3;       if(step==4) {cout〈name[j]) && (p—>name[i] != '\0’)

40、) i++;     if (p—〉name[i] == '\0') {return(false);break;} else      {        k=i;        while ( (p-〉name[k] == q->name[j]) && (q-〉name[j]!='\0’) ) {k++;j++;}       if (q—>name[j]=='\0') return(true);   else     {          j=0;

41、     i++;       }    }     }while( (q->name[j]!='\0’) && (p-〉name[i] != '\0') ); return(false); } void write_to_file() { FILE *fp;    int i,j;  int x[m]; node *p; wait *tempw;   tempw=new wait;     tempw=wait_head;     fp=fopen("piao、dat",”w");

42、  for (i=1;i<=m—1;i++)    { fwrite(&a[i],sizeof(piao),1,fp);   }    fclose(fp); fp=fopen("information、dat","w”);  x[0]=0;x[1]=a[1]、seat[0]; for(i=0,j=1;j<=m-1;j++) {i=i+a[j]、seat[0];x[j]=a[j]、seat[0]+x[j-1];}   j=1;p=head1-〉next; for(j=1;j〈=i;j++) {  

43、   if(j==x[1]+1) p=head2—>next; if(j==x[2]+1) p=head3-〉next;    if(p==NULL)break;     fwrite(p,sizeof(node),1,fp);   p=p->next;   }   fclose(fp);    fp=fopen(”wait、txt","w");   for(j=0;j<=wait_head—>count;j++)   {       if(tempw==NULL)break;   fwrite(tempw,sizeof(wait),1,fp);    tempw=tempw—>next;     }   fclose(fp); }

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服