資源簡介
數據結構課程設計,航空客運訂票系統代碼及實驗報告

代碼片段和文件信息
#include
#include
#include
#include
#define?PR?printf
#define?SC?scanf
typedef?struct?customer{ //客戶信息
char?name[20]; //客戶姓名
int?num; //訂票量
int?level; //艙位等級
customer?*next;
}customer*Lcustomer;
typedef?struct?airline{ //航線信息
char?end_addr[20]; //航線終點
char?line_num[5]; //航班號
char?plant_num[8]; //飛機號
int?day; //飛行日期
int?total; //定員
int?left; //剩余票數
customer?*booked; //已定客戶信息
customer?*wait; //排隊等候訂票信息
airline?*next;
}airline*Lairline;
airline?*L; //將航班信息定義為全局變量,減少參數傳遞
Lairline?search_line() //按航班號查找航班
{
char?a[5];
airline?*p;
p=L->next;
PR(“請輸入航班號“);
SC(“%s“a);
for(;p;p=p->next)
if(!strcmp(ap->line_num))?break;
return?p;
}
Lairline?search_plant() //按飛機號查找航班
{
char?a[8];
airline?*p;
p=L->next;
PR(“請輸入飛機號“);
SC(“%s“a);
for(;p;p=p->next)
if(!strcmp(ap->plant_num))?break;
return?p;
}
Lairline?search_day() //按飛行日期查找航班
{
int?a;
airline?*p;
p=L->next;
PR(“請輸入飛行日期“);
SC(“%d“&a);
for(;p;p=p->next)
if(a==p->day)?break;
return?p;
}
Lairline?search_addr() //按航班終點查找航班
{
char?a[20];
airline?*p;
p=L->next;
PR(“請輸入航班終點“);
SC(“%s“a);
for(;p;p=p->next)
if(!strcmp(ap->end_addr))?break;
return?p;
}
void?more() //設計者信息
{
PR(“\t=======================================\n“);
PR(“\t============?制作人信息?===============\n“);
PR(“\t==========?10級軟件工程4班?============\n“);
PR(“\t===============?黃斌?==================\n“);
PR(“\t============?3110006385?===============\n“);
PR(“\t=======================================\n“);
}
void?guide() //主菜單界面
{
PR(“???------------航空訂票客服系統----------\n“);
PR(“==============================================\n“);
PR(“\t\t顯示所有航線==>??1\n“);
PR(“\t\t查詢航線信息==>??2\n“);
PR(“\t\t訂票業務????==>??3\n“);
PR(“\t\t退票業務????==>??4\n“);
PR(“\t\t管理系統????==>??5\n“);
PR(“\t\t更多????????==>??6\n“);
PR(“\t\t退出系統????==>??0\n“);
PR(“==============================================\n“);
PR(“\t\t清除屏幕信息==>??9\n\n“);
PR(“請按上面指引操作:\t“);
}
void?insert_line() //插入新航班
{
airline?*p*q;
int?flag=1;
for(;flag;)
{
q=(Lairline)malloc(sizeof(airline));
PR(“請輸入航班號:“);
SC(“%s“q->line_num);
for(p=L;p->next;p=p->next)
if(strcmp(p->next->line_numq->line_num)>=0)
break;
if(p->next&&strcmp(p->next->line_numq->line_num)==0)
{
PR(“航班已存在,請重新輸入\n“);
continue;
}
PR(“請輸入飛行日期:“);
SC(“%d“&q->day);
PR(“請輸入飛機號:“);
SC(“%s“q->plant_num);
PR(“請輸入終點站:“);
SC(“%s“q->end_addr);
q->total=120;
q->left=120;
q->booked=NULL;
q->wait=NULL;
q->next=p->next;
p->next=q;
PR(“增加航班成功,是否繼續增加\n繼續(1)\n返回(0)“);
SC(“%d“&flag);
}
}
void?print_customer(airline?*p) //顯示航班客戶信息
{
customer?*c;
if(p->booked)
{
c=p->booked;
PR(“已定票客戶信息\n票數\t/\t客戶姓名\n“);
for(;c;c=c->next)
PR(“%5d\t/\t%s\n“c->numc->name);
PR(“\n\n“);
}
else
PR(“暫時沒有客戶訂票\n\n“);
if(
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????9934??2012-06-30?16:20??航空客運訂票系統代碼及實驗報告\line.cpp
?????文件??????36915??2012-06-30?16:10??航空客運訂票系統代碼及實驗報告\plantline\Debug\line.obj
?????文件?????200762??2012-06-30?16:10??航空客運訂票系統代碼及實驗報告\plantline\Debug\plantline.exe
?????文件?????295756??2012-06-30?16:10??航空客運訂票系統代碼及實驗報告\plantline\Debug\plantline.ilk
?????文件?????222604??2012-06-14?19:47??航空客運訂票系統代碼及實驗報告\plantline\Debug\plantline.pch
?????文件?????525312??2012-06-30?16:10??航空客運訂票系統代碼及實驗報告\plantline\Debug\plantline.pdb
?????文件??????41984??2012-06-30?16:10??航空客運訂票系統代碼及實驗報告\plantline\Debug\vc60.idb
?????文件??????53248??2012-06-30?16:10??航空客運訂票系統代碼及實驗報告\plantline\Debug\vc60.pdb
?????文件???????9934??2012-06-30?16:20??航空客運訂票系統代碼及實驗報告\plantline\line.cpp
?????文件???????4315??2012-06-14?20:02??航空客運訂票系統代碼及實驗報告\plantline\plantline.dsp
?????文件????????526??2012-06-14?18:44??航空客運訂票系統代碼及實驗報告\plantline\plantline.dsw
?????文件??????50176??2012-06-30?16:20??航空客運訂票系統代碼及實驗報告\plantline\plantline.ncb
?????文件??????53760??2012-06-30?16:20??航空客運訂票系統代碼及實驗報告\plantline\plantline.opt
?????文件???????1273??2012-06-30?16:10??航空客運訂票系統代碼及實驗報告\plantline\plantline.plg
?????文件?????200762??2012-06-30?16:10??航空客運訂票系統代碼及實驗報告\plantline.exe
?????文件?????405504??2012-06-30?16:18??航空客運訂票系統代碼及實驗報告\數據結構課程設計報告.doc
?????目錄??????????0??2012-06-30?16:25??航空客運訂票系統代碼及實驗報告\plantline\Debug
?????目錄??????????0??2012-06-30?16:25??航空客運訂票系統代碼及實驗報告\plantline
?????目錄??????????0??2012-07-01?09:49??航空客運訂票系統代碼及實驗報告
-----------?---------??----------?-----??----
??????????????2112765????????????????????19
- 上一篇:PB 12.5 安裝程序及最新破解補丁5629
- 下一篇:38364.rar
評論
共有 條評論