中易网

百分求以下代码—仓库管理系统或航空售票系统

答案:1  悬赏:0  
解决时间 2021-11-01 04:08
百分求以下代码—仓库管理系统或航空售票系统
最佳答案
航空售票系统代码#define N 5#include "stdio.h"#include "stdlib.h"#include "malloc.h"#include "string.h"typedef struct flightdetail{ char customer[10]; int num; struct flightdetail *next;}flightdetail;typedef struct flightmange{ char name[20]; int booked; int ticket; int flightnum; flightdetail *next;}flightmange;void init(flightmange* fl,char fn[][20],int fnum[],int tic[] ){ int i; flightdetail *fd; for(i=0;inext==NULL; }}void printall(flightmange* fl,int *length){ int i; printf("\tAll Flght Information\n\n"); printf("Flightname Flightnum All Sold Rest\n\n"); for(i=0;icustomer,na); p->num=nn; p->next=q; fl[t].next->next=p; fl[t].booked+=nn; printf("\nDear %s,You have successfully booked %s Thanks for Using\n\tPress Any Key to Return",p->customer,fl[t].name); getch(); return; } else { printf("\nSorry,We Don't Have Enougth Ticket(s) For You\n\tPress to Reenter Or Press to Exit"); do { key=getch(); }while(key!='Y'&&key!='y'&&key!='n'&&key!='N'); } if(key=='Y'||key=='y') { system("cls"); printf("Welcome to the Booking System\n\n"); continue; } else { printf("\nBooking Failed ,Thanks for Using"); return; } }}flightdetail* findname(flightdetail *m,char na[]){ flightdetail *p=m; m=m->next; while(m) { if(strcmp(m->customer,na)==0) return p; p=m; m=m->next; } return NULL;}void returntic(flightmange *fl,int *length){ int i=0,n=0,t=999,nn=0; char na[10],key; flightdetail *p,*q; printf("Welcome to the Return Ticket System\n\n"); while(1) { printf("\nStep1.Please Input the Num of the Flight You Want to return:"); scanf("%d",&n); t=findflight(fl,n,length); if(t==999) { printf("\nthe Num of the Flight You Entered Not Find,\n\tPress to Reenter Or Press to Exit"); do { key=getch(); }while(key!='Y'&&key!='y'&&key!='n'&&key!='N'); if(key=='n'||key=='N') { printf("\n\tOperation Failed ,Thanks for Using"); getch(); return; } else{ system("cls"); printf("Welcome to the Booking System\n\n"); continue; } } printf("\nCorrect Flight Num!\n\n"); printf("Step2.Tell Us Your Name,We'll Check Our Database:"); scanf("%s",na); p=findname(fl[t].next,na); if(p==NULL) { printf("\nYour Name Not Find,Make Sure You Have Entered Correctly\n\tPress to Reenter Or Press to Exit"); do { key=getch(); }while(key!='Y'&&key!='y'&&key!='n'&&key!='N'); if(key=='n'||key=='N') { printf("\n\tOperation Failed ,Thanks for Using"); getch(); return; } else{ system("cls"); printf("Welcome to the Booking System\n\n"); continue; } } printf("\nFlightName Yourname TicketQuantity "); printf("\n%-20s%-10s %-5d",fl[t].name,p->next->customer,p->next->num); printf("\nStep3.Now Tell Us How Many Ticket You Want to Retrun:"); scanf("%d",&nn); q=p->next; if(nn>q->num||nnnum-=nn; printf("\nDear %s,You have successfully returned %d %s Ticket(s) Thanks for Using\n\tPress Any Key to Return",q->customer,nn,fl[t].name); if(q->num==0) { p->next=q->next; free(q); } fl[t].booked-=nn; getch(); break; }}void search(flightmange *fl,int *length){ int ff=0,i; char na[10]; flightdetail *p; printf("Enter Your Name:"); scanf("%s",na); printf("\n\nFlightname Flightnum Name Ticket Quantity \n\n"); for(i=0;inext; while(p) { if(strcmp(p->customer,na)==0) { printf("%-20s",(fl[i]).name); printf(" %-8d",(fl[i]).flightnum); printf(" %-10s",p->customer); printf(" %-d\n",p->num); ff++; } p=p->next; } } if(!ff) printf("\n\tNo Match Find"); getch();}void create(flightmange *fl,int *length){ char na[20],password[]="123456",pa[7],key; int m,n,i; flightdetail *p; printf("Enter Password:"); while(1) { for(i=0;inext=NULL; fl[*length].next=p; printf("\n\n\n"); printselect(fl,*length,n); (*length)++; getch();}void main(){ char fn[N][20]={"NingboLondon","NingboShanghai","NingboBeijing","NingboTokyo","NingboNew York"}; int fnum[N]={1001,1002,1003,1004,1005},tic[N]={11,42,32,34,12}; char key; flightmange *fl; int size=50,length=N; fl=(flightmange *)malloc(size*sizeof(flightmange)); init(fl,fn,fnum,tic) ; system("cls"); printf("\t\t\t* * * * * * * * * *\n"); printf("\t\t\tTicket Mange System\n\n\t\t\t\ Programed by Yang Rida\n"); printf("\t\t\t* * * * * * * * * *\n"); printf("\nInfo:This Programe was Compiled With Visual C++,\n And Has Been Tested On TurboC2.0"); getch(); printf("\nInitialize Success!\n\Now Press Any Key to Continue"); getch(); system("cls"); welcome(); while((key=getch())!='6') { switch(key) { case '1' :system("cls");create(fl,&length);system("cls");welcome();break; case '2' :system("cls");booktic(fl,&length);system("cls");welcome();break; case '3' :system("cls");returntic(fl,&length);system("cls");welcome();break; case '4' :system("cls");printall(fl,&length);system("cls");welcome();break; case '5' :system("cls");search(fl,&length);system("cls");welcome();break; default :; } }}
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
武汉好美丽装饰主材品牌有哪些?
不知道哪里能学习到穿衣打扮的技巧?
常州卫校分数线多少
请问布吉高级中学附近的酒店有哪些?高考了,
推心置腹,开诚布公。的意思是什么
什么样的复合地板最环保?
2010春晚节目单
安徽省定远县炉桥镇黄庙村这样处理迁坟合理吗
北京清河翠微商场地下一层修表修的怎么样?
绿壳鸡蛋多少钱一斤?哪里有养的?
我没车了,谁能给我买个车?
得了焦虑症了该怎么办啊?得了焦虑症了该怎么
小霸王热水器打不燃怎么办有电子就是像没电池
中国移动(永兴合作厅)地址在什么地方,想过去
港版妈妈奶粉 雅培 美赞臣 美素佳儿 安满哪个
推荐资讯
世界各品牌汽车的高端产品是什么?
松下集成吊顶电器的市场价格是多少
高分求助。。机房程控电话交换机设备防雷接地
AJ系列现在都有哪些代?
美式冷式咖啡有什么样的制作方法?
哪里隆鼻最实惠?
为什么人的脸上会长痣?
圣大保罗和海伦凯勒的眼镜怎么样
香薰小雨地址在什么地方,想过去办事
有什么比比霜好用,用上去比较自然,遮瑕效果
营养键康坊地址在什么地方,我要处理点事
梦见自己头发掉了好多又戴上假发周公解梦
手机登qq时,显示手机磁盘不足,清理后重新登
刺客的套装怎么选啊?