導航:首頁 > 源碼編譯 > 航空公司源碼定製

航空公司源碼定製

發布時間:2023-07-01 20:01:11

❶ 機票預訂系統 pb C++ C語言源代碼都行

具體功能呢?
題目都不說清楚

補充:這是大工程啊

❷ 飛機訂票系統的源代碼

機票預定系統概要設計說明書1.引言
1.1 編寫目的
在本機票預定系統項目的前一階段,也就是需求分析階段中,已經將系統用戶對本系統的需求做了詳細的闡述,這些用戶需求已經在上一階段中對航空公司、各旅行社及機場的實地調研中獲得,並在需求規格說明書中得到詳盡得敘述及闡明。
本階段已在系統的需求分析的基礎上,對機票預定系統做概要設計。主要解決了實現該系統需求的程序模塊設計問題。包括如何把該系統劃分成若干個模塊、決定各個模塊之間的介面、模塊之間傳遞的信息,以及數據結構、模塊結構的設計等。在以下的概要設計報告中將對在本階段中對系統所做的所有概要設計進行詳細的說明。
在下一階段的詳細設計中,程序設計員可參考此概要設計報告,在概要設計對機票預定系統所做的模塊結構設計的基礎上,對系統進行詳細設計。在以後的軟體測試以及軟體維護階段也可參考此說明書,以便於了解在概要設計過程中所完成的各模塊設計結構,或在修改時找出在本階段設計的不足或錯誤。 1.2 項目背景 本項目(機票預定系統)時由浙江航空公司委託,由<>負責開發。
機票預定系統將由兩部分組成:置於個旅行社定票點的前台客戶程序,以及置於航空公司的資料庫伺服器。本系統與其他系統的關系如下: 1.3 定義 1.3.1 專門術語
SQL SERVER: 系統伺服器所使用的資料庫管理系統(DBMS)。
SQL: 一種用於訪問查詢資料庫的語言
事務流:數據進入模塊後可能有多種路徑進行處理。
主鍵:資料庫表中的關鍵域。值互不相同。
外部主鍵:資料庫表中與其他表主鍵關聯的域。
ROLLBACK: 資料庫的錯誤恢復機制。
1
1.3.2 縮寫
系統:若未特別指出,統指本機票預定系統。
SQL: Structured Query Language(結構化查詢語言)。
ATM: Asynchronous Transfer Mode (非同步傳輸模式)。
1.4 參考資料 以下列出在概要設計過程中所使用到的有關資料:
1. 機票預定系統項目計劃任務書 浙江航空公司 1999/3 2.機票預定系統項目開發計劃 《》軟體開發小組 1999/3
3.需求規格說明書 《》軟體開發小組 1999/3
4.用戶操作手冊(初稿) 《》軟體開發小組 1999/4
5.軟體工程及其應用 周蘇、王文等 天津科學技術出版社 1992/1
6.軟體工程 張海藩 清華大學出版社 1990/11
7.Computer Network A.S.Tanenbaun Prentice Hall 1996/01
文檔所採用的標準是參照《軟體工程導論》沈美明著 的「計算機軟體開發文檔編寫指南」。
2.任務概述

❸ 航空公司訂票系統源代碼 要求要 c++ 來寫

#include <iostream.h>
#include <stdio.h>
#include <string.h>
#include <conio.h>
#define m 4 //3架飛機
#define n 5 //每架飛機5張票

struct node
{
char name[21];
char id[21];
int seat,plane,date;
node *next,*pre;
};
struct wait
{
char name[21];
char id[21];
char phone[8];
int seat,plane,date,count;
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(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 comp(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();
cout<<endl<<"choose an operation: ";
cin>>c;
if (c!='6')
switch(c)
{
case '0' : show_wait();break;
case '1' : {list_piao();book();}break;
case '2' : search_delete(1);break;
case '3' : list_piao();break;
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()
{ cout<<endl<<"";
cout<<endl<<" 菜單";
cout<<endl<<" ************************";
cout<<endl<<" * 0 . 查看排隊情況 *";
cout<<endl<<" * 1 . 訂票 *";
cout<<endl<<" * 2 . 退票 *";
cout<<endl<<" * 3 . 查看剩餘票 *";
cout<<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 )
{
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()
{
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;
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->next=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=new 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("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;
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<<endl;
}
else cout<<endl<<"The "<<i<<" plane is full !"<<endl<<endl;
}
}
void list_information()
{
int x;
do {cout<<endl<<"顯示哪架飛機的信息 ? "; cin>>x;cout<<endl;}while(x<1 || x>=m);
cout<<endl<<"第 "<<x<<" 架飛機的信息如下 "<<endl;
if(x==1) plane_information(head1);
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<<"飛機空,無預訂票 !"<<endl;
}
while(q!=NULL)
{
cout<<endl<<"*******************"<<endl;
q->date=q->plane;
cout<<"日期 :"<<q->date<<endl;
cout<<"座位號 : "<<q->seat<<endl;
cout<<"姓名 : "<<q->name;
cout<<endl<<"ID 號 : "<<q->id;
q=q->next;x++;
if (x % 3 ==0) 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<<"**** 超出范圍!****"<<endl<<"請重新輸入:";
}
else
{cout<<endl<<"你要訂的是到"<<i<<"地的飛機"<<endl;
cout<<endl<<"第 "<<i<<" 架飛機剩餘的票 :"<<endl;
for(p=1;p<=n;p++)
if (a[i].seat[p]==0) cout<<" "<<p;
cout<<endl;
break;}
}while(1);
cout<<endl<<"請選擇座位號 : ";
do {
cin>>j;
if (j<1 || j>n) {
cout<<endl<<"**** 超出范圍!****"<<endl<<"請重新輸入:";
}
else
{
q->date=i;
cout<<endl<<"您的訂票日期 : "<<q->date<<endl;
break;
}
}while(1);

if (a[i].seat[j]==0) {
a[i].seat[j]=1;
cout<<endl;
a[i].seat[0]++;
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<<"**** 對不起,該座位已被預訂,您被安排到訂票等候隊列 ****"<<endl;
add_wait(i,j);
}

}
void add_wait(int x,int y)
{
wait *tempw;
tempw=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=wait_end;
wait_end=wait_end->next;
cout<<endl<<"**** 正在排隊等候 ****"<<endl;
wait_head->count++;
write_to_file();
}
void show_wait()
{
wait *tempw;
tempw=wait_head->next;
if (tempw==NULL) cout<<endl<<"排隊中沒有人!"<<endl;
while(tempw!=NULL)
{
cout<<tempw->name<<" - ";
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>>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<<endl<<"**** 訂票成功 ****"<<endl;
}
void search_delete(int x)
{
node *p,*q,*r;
wait *tempw,*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<<"請輸入個人信息"<<endl;
cout<<"*************"<<endl;
cout<<endl<<"姓名 : ";cin>>p->name;
do{
q=q->next;
if ( (q!=NULL) &&
(comp(q,p)) )
{
cout<<endl;
q->date=q->plane;
cout<<"Located!"<<endl;
cout<<"****************";
cout<<endl<<"姓名 : "<<q->name;
cout<<endl<<"ID號 : "<<q->id;
cout<<endl<<"座位號 : "<<q->seat;
cout<<endl<<"班機號 : "<<q->plane;
cout<<endl<<"日期 : "<<q->date<<endl;
if (x==1) {
cout<<"刪除該紀錄 ? [Y/N] ";
cin>>ch;
if (ch=='Y' || ch=='y') {
t1=q->plane;
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<<"**** 記錄刪除成功 ! ****";
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) && (tempw->seat==t2))
{
strcpy(tempw3->name,tempw->name);
strcpy(tempw3->phone,tempw->phone);
cout<<endl<<"等候的人中有可以訂票的了:"<<endl;
cout<<endl<<"姓名 : "<<tempw->name;
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) 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;
else tempw->next->pre=tempw2;
delete(tempw);
wait_head->count--;
write_to_file();
cout<<endl<<"等候的"<<tempw3->name<<"已經成功訂票,已經由電話"<<tempw3->phone<<"通知了"<<endl;
break;
}
}

}
}continue;
}
else
{
if (q==NULL)
{
step++;
if(step==2) q=head2;
if(step==3) q=head3;
if(step==4) {cout<<endl<<"**** 信息檢索完畢 ****";break;}
}
}
}while(1);
}
bool comp(node *x,node *y)
{
node *p,*q;
int i,j,k;
p=x;
q=y;
i=j=0;
do
{
while ( (p->name[i] != q->name[j]) && (p->name[i] != '\0') ) 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;
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");
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++)
{
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);
}

閱讀全文

與航空公司源碼定製相關的資料

熱點內容
dvd光碟存儲漢子演算法 瀏覽:757
蘋果郵件無法連接伺服器地址 瀏覽:962
phpffmpeg轉碼 瀏覽:671
長沙好玩的解壓項目 瀏覽:144
專屬學情分析報告是什麼app 瀏覽:564
php工程部署 瀏覽:833
android全屏透明 瀏覽:737
阿里雲伺服器已開通怎麼辦 瀏覽:803
光遇為什麼登錄時伺服器已滿 瀏覽:302
PDF分析 瀏覽:484
h3c光纖全工半全工設置命令 瀏覽:143
公司法pdf下載 瀏覽:381
linuxmarkdown 瀏覽:350
華為手機怎麼多選文件夾 瀏覽:683
如何取消命令方塊指令 瀏覽:349
風翼app為什麼進不去了 瀏覽:778
im4java壓縮圖片 瀏覽:362
數據查詢網站源碼 瀏覽:150
伊克塞爾文檔怎麼進行加密 瀏覽:892
app轉賬是什麼 瀏覽:163