旅游线路管理_第1页
旅游线路管理_第2页
旅游线路管理_第3页
旅游线路管理_第4页
旅游线路管理_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

-.z.#include<bits/stdc++.h>usingnamespacestd;intPassword=123456;intnum;//记录员工人数structNode{//线路链表 intID; charBegin[120]; charEnd[120]; intMoney; intsum; intsum_money; structNode*Ne*t;};structCustomer{//客户信息表 charname[120]; charse*[120]; charnumber[15]; charid[30]; chartime[30]; charend[120]; intnumb; intflag;//是否付款 structCustomer*Ne*t;};structPerson{//员工信息表 charEname[120]; charame[120]; charSe*[120]; intAge; intflag;// structPerson*Ne*t;}Edge[1024];voidMenu(){ printf("---------------------------------------------------------------------------\n"); printf("+--------------+\n"); printf("+<请选择业务>+\n"); printf("+--------------+\n"); printf("+根底信息业务管理+\n"); printf("++\n"); printf("+请输入[1]请输入[2]+\n"); printf("++\n"); printf("++\n"); printf("+信息咨询统计分析+\n"); printf("++\n"); printf("+请输入[3]请输入[4]+\n"); printf("++\n"); printf("++\n"); printf("+完毕程序请按[0]+\n"); printf("---------------------------------------------------------------------------\n");}voidStart(){//口令界面 while(1){ printf("\n\n\n欢送来到旅游线路管理系统\n\n\n"); printf("请输入口令进入系统:"); intans; scanf("%d",&ans); if(ans==Password){ system("cls"); break; } else{ printf("\n\n口令输入有误,请按任意键后重新输入\n\n"); getchar(); getchar(); } system("cls"); }}voidRead(structNode*Head,structCustomer*head){//从文件中读入 structNode*p; structCustomer*q; q=head; p=Head; ifstreaminfile; infile.open("线路.t*t",ios::in); while(!infile.eof()){ structNode*New=(structNode*)malloc(sizeof(structNode)); infile>>New->ID; infile>>New->Begin; infile>>New->End; infile>>New->Money; infile>>New->sum; infile>>New->sum_money; //infile.get(); if(New->Money==0){//终止条件 deleteNew; break; } p->Ne*t=New; New->Ne*t=NULL; p=p->Ne*t; } infile.close(); infile.open("员工.t*t",ios::in); num=0; while(!infile.eof()){ infile>>Edge[num].Ename; infile>>Edge[num].ame; infile>>Edge[num].Age; infile>>Edge[num].Se*; infile>>Edge[num++].flag; } num--; infile.close(); infile.open("客户.t*t",ios::in);// if(!infile){// cout<<"esa"<<endl;41// } while(!infile.eof()){ structCustomer*New=(structCustomer*)malloc(sizeof(structCustomer)); infile>>New->name; infile>>New->se*; infile>>New->number; infile>>New->id; infile>>New->time; infile>>New->end; infile>>New->numb; infile>>New->flag; if(New->numb==0){ deleteNew; break; } q->Ne*t=New; New->Ne*t=NULL; q=q->Ne*t; } infile.close();}voidfun1(structNode*Head){//根底信息功能 structNode*p; intm; printf("\n\n<根底信息>\n\n\n"); printf("查询线路信息[1],查询员工信息[2]\n\n新建旅游路线[3],新建员工信息[4]:"); scanf("%d",&m); p=Head; if(m==1){ system("cls"); printf("-----------------------------------------"); printf("\n当前所有旅游线路信息\n\n"); while(p->Ne*t!=NULL){//遍历输出所有线路 printf("*%04d%s%s%d\n",p->Ne*t->ID,p->Ne*t->Begin,p->Ne*t->End,p->Ne*t->Money); p=p->Ne*t; } printf("-----------------------------------------\n"); } elseif(m==2){ system("cls"); printf("\n\n当前所有的员工信息:\n\n"); for(inti=0;i<num;i++){ printf("英文名:%s\t中文名:%s\t年龄:%d\t性别:%s\n\n",Edge[i].Ename,Edge[i].ame,Edge[i].Age,Edge[i].Se*); } } elseif(m==3){ inttemp; system("cls"); printf("\n请输入需要创立的线路个数:"); scanf("%d",&temp); p=Head; while(p->Ne*t!=NULL){//从最后开场添加 p=p->Ne*t; } while(temp--){ structNode*New=(structNode*)malloc(sizeof(structNode)); printf("请输入线路的起点,终点,费用(中间以空格隔开):"); scanf("%s%s%d",New->Begin,New->End,&New->Money); New->sum=0; New->sum_money=0; New->ID=p->ID+1; New->Ne*t=NULL; p->Ne*t=New; p=p->Ne*t; printf("\n创立成功!\n按回车键继续...\n"); getchar(); getchar(); } } else{ intn; printf("\n请输入需要录入员工的人数:"); scanf("%d",&n); while(n--){ printf("请依次输入员工的英文名,中文名,年龄,性别(中间以空格隔开):"); scanf("%s%s%d%s",Edge[num].Ename,Edge[num].ame,&Edge[num].Age,Edge[num].Se*); Edge[num++].flag=0; printf("\n录入成功!\n按回车键继续...\n"); getchar(); getchar(); } } printf("\n\n继续操作请按1,返回主菜单请按0\n"); inttemp; scanf("%d",&temp); if(temp==1){ system("cls"); fun1(Head); }}voidfun2(structNode*Head,structCustomer*head){//业务管理 while(1){ system("cls"); printf("\n\n<业务管理>\n\n"); intm; printf("业务登记[1]线路匹配[2]\n\n业务结算[3]返回主菜单[0]\n\n请输入功能选项:"); scanf("%d",&m); if(m==1){ system("cls"); printf("\n\n<业务登记>\n\n"); printf("请依次输入客户的**、性别、联系、**号、旅游景点、登记日期、出行人数:\n"); structCustomer*p; p=head; structCustomer*New=(structCustomer*)malloc(sizeof(structCustomer)); scanf("%s%s%s%s%s%s%d",New->name,New->se*,New->number,New->id,New->end,New->time,&New->numb); New->flag=0; p->Ne*t=New; New->Ne*t=NULL; p=p->Ne*t; printf("登记成功!"); printf("请按任意键继续...\n"); getchar();getchar(); } elseif(m==2){ printf("\n\n<线路匹配>\n\n"); printf("请输入您的**号:"); charstr[120]; scanf("%s",str); structCustomer*p; p=head; intflag=0; while(p->Ne*t!=NULL){ if(strcmp(p->Ne*t->id,str)==0){ structNode*q; q=Head; flag=1; intflag1=0; while(q->Ne*t!=NULL){ if(strcmp(q->Ne*t->End,p->Ne*t->end)==0){ system("cls"); printf("\n\n当前为您安排的线路出发点为:%s目的地为:%s价格为:%d当前该旅游景点的人数为:%d\n",q->Ne*t->Begin,q->Ne*t->End,q->Ne*t->Money,q->Ne*t->sum); flag1=1; getchar();getchar(); } q=q->Ne*t; } if(!flag1){ printf("\n抱歉,您所要去的旅游景点暂无信息。\n"); getchar();getchar(); } } p=p->Ne*t; } if(!flag){ printf("\n您输入的有误或者该客户不存在。\n"); getchar();getchar(); } } elseif(m==3){ printf("\n\n<业务结算>\n\n"); printf("请输入您的**号:"); charstr[120]; scanf("%s",str); structCustomer*p; p=head; intflag=0; while(p->Ne*t!=NULL){ if(strcmp(p->Ne*t->id,str)==0){ flag=1; structNode*q; q=Head; intflag1=0; while(q->Ne*t!=NULL){ if(strcmp(q->Ne*t->End,p->Ne*t->end)==0){ flag1=1; printf("\n您需要一共缴费%d元\n",q->Ne*t->Money*p->Ne*t->numb); getchar(); getchar(); p->Ne*t->flag=1; q->Ne*t->sum_money+=p->Ne*t->numb*q->Ne*t->Money; q->Ne*t->sum+=p->Ne*t->numb; } q=q->Ne*t; } } p=p->Ne*t; } if(!flag){ printf("\n您输入的有误或者该客户不存在\n"); getchar(); getchar(); } } else{ break; } }}voidfun3(structNode*Head,structCustomer*head){ while(1){ system("cls"); printf("\n\n<信息咨询>\n\n"); printf("线路信息查询[1]人员信息查询[2]\n\n业务登记查询[3]确认出游查询[4]\n\n业务结算查询[5]返回主菜单[0]\n\n"); intm; printf("请输入功能选项:"); scanf("%d",&m); if(m==1){ structNode*p; p=Head; system("cls"); printf("-----------------------------------------"); printf("\n当前所有旅游线路信息\n\n"); while(p->Ne*t!=NULL){//遍历输出所有线路 printf("*%s%s%d\n",p->Ne*t->Begin,p->Ne*t->End,p->Ne*t->Money); p=p->Ne*t; } printf("-----------------------------------------\n\n按任意键返回..."); getchar(); getchar(); } elseif(m==2){ system("cls"); printf("--------------------------------------------------------------------"); printf("\n\n当前所有的员工信息:\n\n"); for(inti=0;i<num;i++){ printf("**英文名:%s\t中文名:%s\t年龄:%d\t性别:%s\n\n",Edge[i].Ename,Edge[i].ame,Edge[i].Age,Edge[i].Se*); } printf("--------------------------------------------------------------------\n\n按任意键返回..."); getchar(); getchar(); } elseif(m==3){ system("cls"); structCustomer*p; p=head; printf("\n业务登记查询\n"); printf("------------------------------------------------------------------------------------------\n\n"); while(p->Ne*t!=NULL){ printf("****:%s性别:%s:%s**号:%s登记日期%s\n旅游地点:%s出游人数:%d\n\n",p->Ne*t->name,p->Ne*t->se*,p->Ne*t->number,p->Ne*t->id,p->Ne*t->time,p->Ne*t->end,p->Ne*t->numb); p=p->Ne*t; } printf("------------------------------------------------------------------------------------------\n\n按任意键继续..."); getchar();getchar(); } elseif(m==4){ system("cls"); printf("\n确认出游客户登记表\n"); printf("-------------------------------------------------------------------\n\n"); structCustomer*p; p=head; while(p->Ne*t!=NULL){ if(p->Ne*t->flag==1){ structNode*q;// cout<<"yes"<<endl; q=Head; while(q->Ne*t!=NULL){ if(strcmp(q->Ne*t->End,p->Ne*t->end)==0){ printf("****:%s性别:%s:%s**号:%s登记日期%s\n旅游地点:%s出发地点:%s出游人数:%d已支付金额:%d\n\n",p->Ne*t->name,p->Ne*t->se*,p->Ne*t->number,p->Ne*t->id,p->Ne*t->time,p->Ne*t->end,q->Ne*t->Begin,p->Ne*t->numb,p->Ne*t->numb*q->Ne*t->Money);// getchar();// getchar(); break; } q=q->Ne*t; } } p=p->Ne*t; } printf("-------------------------------------------------------------------\n\n请按任意键继续..."); getchar(); getchar(); } elseif(m==5){ while(1){ system("cls"); printf("\n\n业务结算查询\n"); structCustomer*p; p=head; printf("\n请输入您要查询的客户的**号〔输入0退出〕:"); charstr[120]; scanf("%s",str); if(strcmp(str,"0")==0)break; intflag=0; while(p->Ne*t!=NULL){ if(strcmp(p->Ne*t->id,str)==0){ flag=1; if(p->Ne*t->flag==0){ printf("\n该客户还未付款\n"); } else{ printf("\n该客户已经付款\n"); } } p=p->Ne*t; } if(flag==0){ printf("\n您输入有误或该客户不存在\n"); getchar();getchar(); } else{ printf("\n按任意键继续...\n"); getchar();getchar(); break; } } } elsebreak; }}voidfun4(structNode*Head,structCustomer*head){ while(1){ system("cls"); printf("\n\n统计分析\n\n"); printf("记录业务汇总表[1]确认出游汇总表[2]\n\n业务结算汇总表[3]自定义排序业务汇总表[4]\n\n返回主菜单[0]\n"); intm; printf("请输入功能选项:"); scanf("%d",&m); if(m==1){ system("cls"); inttemp=1; structCustomer*p; p=head; printf("\n业务汇总表\n"); printf("--------------------------------------------------------------------------------------\n\n"); while(p->Ne*t!=NULL){ printf("**客户编号:%04d客户**:%s客户联系方式:%s客户旅游景点:%s\n出发时间:%s当前状态(0表示未付款):%d\n\n",temp++,p->Ne*t->name,p->Ne*t->number,p->Ne*t->end,p->Ne*t->time,p->Ne*t->flag); p=p->Ne*t; } printf("--------------------------------------------------------------------------------------\n\n请按任意键继续..."); getchar();getchar(); } elseif(m==2){ system("cls"); printf("\n确认出游汇总表\n"); structCustomer*p; p=head; inttemp=1;// printf("\n汇总表\n"); printf("--------------------------------------------------------------------------------------\n\n"); while(p->Ne*t!=NULL){ if(p->Ne*t->flag==1) printf("**客户编号:%04d客户**:%s客户联系方式:%s客户旅游景点:%s\n出发时间:%s\n\n",temp++,p->Ne*t->name,p->Ne*t->number,p->Ne*t->end,p->Ne*t->time); p=p->Ne*t; } printf("--------------------------------------------------------------------------------------\n\n请按任意键继续..."); getchar();getchar(); } elseif(m==3){ system("cls"); printf("\n业务结算汇总表\n"); structNode*p; p=Head; printf("--------------------------------------------------------------------------------------\n\n"); while(p->Ne*t!=NULL){ printf("**线路编号:%04d线路起点:%s线路终点:%s该旅游景点人数:%d\n该线路的总收入:%d\n\n",p->Ne*t->ID,p->Ne*t->Begin,p->Ne*t->End,p->Ne*t->sum,p->Ne*t->sum_money); p=p->Ne*t; } printf("--------------------------------------------------------------------------------------\n\n请按任意键继续..."); getchar();getchar(); } elseif(m==4){ system("cls"); printf("\n自定义排序汇总表\n\n"); printf("按旅游景点人数排序(升序)[1]按旅游景点总收入排序(降序)[2]\n\n按编号排序[3]返回主菜单[0]\n\n"); intm; printf("请输入自定义排序的编号:"); scanf("%d",&m); if(m==1){ structNode*p; structNode*q; chare*[20]="1"; //交换字符数组 inte*c; //交换数字 for(p=Head->Ne*t;p!=NULL;p=p->Ne*t){ for(q=p->Ne*t;q!=NULL;q=q->Ne*t){ if(p->sum>q->sum){ strcmp(e*,p->Begin); strcmp(p->Begin,q->Begin); strcmp(q->Begin,e*); strcmp(e*,p->End); strcmp(p->End,q->End); strcmp(q->End,e*); e*c=p->ID; p->ID=q->ID; q->ID=e*c; e*c=p->Money; p->Money=q->Money; q->Money=e*c; e*c=p->sum; p->sum=q->sum; q->sum=e*c; e*c=p->sum_money; p->sum_money=q->sum_money; q->sum_money=e*c; } } } p=Head; printf("--------------------------------------------------------------------------------------\n\n"); while(p->Ne*t!=NULL){ printf("**线路编号:%04d线路起点:%s线路终点:%s该旅游景点人数:%d\n该线路的总收入:%d\n\n",p->Ne*t->ID,p->Ne*t->Begin,p->Ne*t->End,p->Ne*t->sum,p->Ne*t->sum_money); p=p->Ne*t; } printf("--------------------------------------------------------------------------------------\n\n请按任意键继续..."); getchar();getchar(); } elseif(m==2){ structNode*p; structNode*q; chare*[20]="1"; //交换字符数组 inte*c; //交换数字 for(p=Head->Ne*t;p!=NULL;p=p->Ne*t){ for(q=p->Ne*t;q!=NULL;q=q->Ne*t){ if(p->sum_money<q->sum_money){ strcmp(e*,p->Begin); strcmp(p->Begin,q->Begin); strcmp(q->Begin,e*); strcmp(e*,p->End); strcmp(p->End,q->End); strcmp(q->End,e*); e*c=p->ID; p->ID=q->ID; q->ID=e*c; e*c=p->Money; p->Money=q->Money; q->Money=e*c; e*c=p->sum; p->sum=q->sum; q->sum=e*c; e*c=p->sum_money; p->sum_money=q->sum_money; q->sum_money=e*c; } } } p=Head; printf("--------------------------------------------------------------------------------------\n\n"); while(p->Ne*t!=NULL){ printf("**线路编号:%04d线路起点:%s线路终点:%s该旅游景点人数:%d\n该线路的总收入:%d\n\n",p->Ne*t->ID,p->Ne*t->Begin,p->Ne*t->End,p->Ne*t->sum,p->Ne*t->sum_money); p=p->Ne*t; } printf("--------------------------------------------------------------------------------------\n\n请按任意键继续..."); getchar();getchar(); } elseif(m==3){ structNode*p; structNode*q; chare*[20]="1"; //交换字符数组 inte*c; //交换数字 for(p=Head->Ne*t;p!=NULL;p=p->Ne*t){ for(q=p->Ne*t;q!=NULL;q=q->Ne*t){ if(p->ID>q->ID){ strcmp(e*,p->Begin); strcmp(p->Begin,q->Begin); strcmp(q->Begin,e*); strcmp(e*,p->End); strcmp(p->End,q->End); strcmp(q->End,e*); e*c=p->ID; p->ID=q->ID; q->ID=e*c; e*c=p->Money; p->Money=q->Money; q->Money=e*c; e*c=p->sum; p->sum=q->sum; q->sum=e*c; e*c=p->sum_money; p->sum_money=q->sum_money; q->sum_money=e*c; } } } p=Head; printf("--------------------------------------------------------------------------------------\n\n"); while(p->Ne*t!=NULL){ printf("**线路编号:%04d线路起点:%s线路终点:%s该旅游景点人数:%d\n该线路的总收入:%d\n\n",p->Ne*t->ID,p->Ne*t->Begin,p->Ne*t->End,p->Ne*t->sum,p->Ne*t->sum_money); p=p->Ne*t; } printf("--------------------------------------------------------------------------------------\n\n请按任意键继续..."); getchar();getchar(); } } elseif(m==0)break; }}voidWrite(structNode*Head,structCustomer*head){ struct

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论