資源簡介
C語言編寫航空訂票系統-期末課程設計
1.航空訂票系統
功能要求:
(1)錄入:可以錄入航班情況(數據可以存儲在一個數據文件中,數據結構、具體數據自定)
查詢:可以查詢某個航線的情況(如,輸入航班號,查詢起降時間,起飛抵達城市,航班票價,票價折扣,確定航班是否滿倉);
可以輸入起飛抵達城市,查詢飛機航班情況;
訂票:(訂票情況可以存在一個數據文件中,結構自己設定)
可以訂票,如果該航班已經無票,可以提供相關可選擇航班;
退票: 可退票,退票后修改相關數據文件;
客戶資料有姓名,證件號,訂票數量及航班情況,訂單要有編號。
修改航班信息:當航班信息改變可以修改航班數據文件
人機界面自定義,要友好。
漢化人機界面

代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
int?Locateair(char?name[]);
/*?*******************結構體定義*******************?*/?
struct?ord_ros
{
char?name[20];/*客戶姓名*/
char?IDnum[20];/*客戶有效證件的編號*/
char?airnum[7];/*航班號*/
int?dpl;/*訂票量*/
char?piaohao[20];//票的編號,由航班號起飛日期此航班訂票前的余票量
struct?ord_ros?*next;
}*Phead?*Pother;
struct?passper
{
char?pername[20];
char?password[16];
struct?passper?*next;
}*Passhead?*Passother;
struct?airline
{
char?qdname[20];/*起點站名*/
char?zdname[20];/*終點站名?*/
char?air_num[7];/*航班號*/
char?plane_num[10];/*飛機型號*/
int?year;
int?month;
int?day;/*飛行日期*/
int?qhour;
int?qminute;/*起飛時間*/
int?jhour;
int?jminute;/*降落時間*/
float?zhekou;/*沒有折扣為十折*/
float?price;/*票價*/
int?tkt_amt;/*乘員定額*/
int?tkt_sur;/*余票量*/
struct?airline??*next;/*指向下一個結點*/
}*Ahead?*Aother;
/*************************************************************/
int?readA()//打開文件函數?
{
int?t;
FILE?*p;
if?((p?=?fopen(“airplane.txt“?“r“))?==?NULL) /*2.打開文件*/
{
printf(“File?open?error!\n“);
exit(0);
}
fscanf(p?“%d“?&t);
return?t;
}
int?readP()//打開文件函數?
{
int?t;
FILE?*p;
if?((p?=?fopen(“passenger.txt“?“r“))?==?NULL) /*2.打開文件*/
{
printf(“File?open?error!\n“);
exit(0);
}
fscanf(p?“%d“?&t);
return?t;
}
int?readPass()//打開文件函數?
{
int?t;
FILE?*p;
if?((p?=?fopen(“password.txt“?“r“))?==?NULL) /*2.打開文件*/
{
printf(“File?open?error!\n“);
exit(0);
}
fscanf(p?“%d“?&t);
return?t;
}
void?start()??//?飛機載入文件函數?
{
FILE?*pFile?=?fopen(“start.txt“?“rb+“);
if?(pFile?==?NULL)
{
printf(“File?open?error!\n“);
return;
}
char?ch;
while?((ch?=?fgetc(pFile))?!=?EOF)
{
fputc(ch?stdout);
}
fclose(pFile);
}
void?start_first()??//?動態打印飛機?
{
system(“color?f2“);
start();
printf(“系統加載中…“);
Sleep(400);
system(“cls“);
system(“color?fb“);
start();
printf(“系統加載中……“);
Sleep(400);
system(“cls“);
system(“color?f9“);
start();
printf(“系統加載中………“);
Sleep(400);
system(“cls“);
system(“color?fc“);
start();
printf(“系統加載完成!!!\n\n“);
system(“pause“);
}
void?shengming()?????????//登陸聲明函數??
{
system(“color?f9“);
printf(“\n\n“);
printf(“\t\t\t???*******************************????\n“);
printf(“\t\t\t?|????????◆??Welcome?To??◆????????|??\n“);
printf(“\t\t\t???════════════════????\n“);
printf(“\t\t\t?|??????????Summer航空系統??????????|??\n“);
printf(“\t\t\t???════════════════????\n“);
printf(“\t\t\t?|??????????版本號:1.16.5??????????|\n\n“);
printf(“\t\t\t?|???????????2018年1月16日??????????|\n\n“);
printf(“\t\t\t?|??????????????周永強??????????????|\n\n“);
printf(“\t\t\t?|???????????Summer?Lotus???????????|\n\n“);
printf(“\t\t\t?|???????????????組長???????????????|\n\n“);
printf(“\t\t\t?|????王夏荷?陳藍艷?林楠?韋淑坤?????|\n\n“);
printf(“\t\t\t?|???????????????組員???????????????|\n\n“);
printf(“\t\t\t??^^^^^^^^^^^^^^^^^^^^^^^^^^^^?\n\n“);
system(“
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-01-16?23:09??Airplane?5.0\
?????文件???????30851??2018-01-16?23:19??Airplane?5.0\1.1.cpp
?????文件??????392779??2018-01-16?23:09??Airplane?5.0\1.1.exe
?????文件?????????567??2018-01-16?23:04??Airplane?5.0\airplane.txt
?????文件?????????479??2018-01-16?21:01??Airplane?5.0\passenger.txt
?????文件?????????104??2018-01-16?13:56??Airplane?5.0\password.txt
?????文件????????1279??2018-01-16?15:29??Airplane?5.0\start.txt
- 上一篇:C語言課程設計C語言課程設計.
- 下一篇:VC++視頻幀提取軟件
評論
共有 條評論