当前位置:首页 » 课程大全 » 飞机课程设计

飞机课程设计

发布时间: 2020-11-28 06:00:28

⑴ JAVA数据结构课程设计,航空订票系统求助


今天比较闲,编了一套,一共4个class。不懂再问。

这格式真要命,凑活看吧。

publicenumAirClass{
FIRST,
SECOND,
THIRD
}

--------------------------------------------


publicclassCustomer{
privateStringname;
privateintticketNumber;
privateAirClassairClass;
publicCustomer(Stringname,intticketNumber,AirClassairClass){
this.name=name;
this.ticketNumber=ticketNumber;
this.airClass=airClass;
}
publicStringgetName(){returnname;}
publicvoidsetName(Stringname){this.name=name;}
publicintgetTicketNumber(){returnticketNumber;}
publicAirClassgetAirClass(){returnairClass;}
}

------------------------------------------------


importjava.util.LinkedList;
importjava.util.List;

publicclassAirLine{
privateStringdestination;
privateStringflightName;
privateStringflightNumber;
privateintdayOfWeek;
privateintcapacity;
privateintremainder;
privateList<Customer>booking=newLinkedList<Customer>();
privateList<Customer>preBooking=newLinkedList<Customer>();

publicAirLine(Stringdestination,StringflightName,StringflightNumber,intdayOfWeek,intcapacity){
this.destination=destination;
this.flightName=flightName;
this.flightNumber=flightNumber;
this.dayOfWeek=dayOfWeek;
this.capacity=capacity;
this.remainder=capacity;}
publicStringgetDestination(){returndestination;}
publicStringgetFlightName(){returnflightName;}
publicStringgetFlightNumber(){returnflightNumber;}
publicintgetDayOfWeek(){returndayOfWeek;}
publicintgetCapacity(){returncapacity;}
publicintgetRemainder(){returnremainder;}
publicList<Customer>getBooking(){returnbooking;}
publicList<Customer>getPreBooking(){returnpreBooking;}

publicbooleanaddBooking(Customerc){
if(this.remainder>=c.getTicketNumber()){
this.remainder=this.remainder-c.getTicketNumber();
this.booking.add(c);
returntrue;
}else{
this.preBooking.add(c);
returnfalse;
}
}

publicvoidremoveBooking(Customerc){
if(this.booking.contains(c)){
this.booking.remove(c);
this.remainder=this.remainder+c.getTicketNumber();
}else{
("Customernotfound.");
}
}

publicvoidremovePreBooking(Customerc){
if(this.preBooking.contains(c)){
this.preBooking.remove(c);
}else{
("Customernotfound.");
}
}

publicStringtoString(){
returnthis.flightName+":"+this.flightNumber+":"
+this.dayOfWeek+":"+this.remainder;
}
}

---------------------------------


importjava.util.Calendar;importjava.util.Date;
importjava.util.LinkedList;importjava.util.List;
importjava.util.concurrent.TimeUnit;

publicclassMain{
privateList<AirLine>airLines=newLinkedList<AirLine>();

privatevoidinit(){
finalAirLineairLine1=newAirLine("beijing","flightName","flightNumber",Calendar.MONDAY,300);
this.airLines.add(airLine1);
//自己加新的airLine2,airLine3...

finalCustomercustomer1=newCustomer("Tom",2,AirClass.FIRST);
airLine1.addBooking(customer1);
//自己加新的customer2,customer3...
}

publicAirLinesearch(Stringdestination){
if(destination==null)returnnull;
finalintcurrenDayOfWeek=Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
AirLineres=null;
intdiffToCurrenDate=7;
for(AirLinea:airLines){
if(destination.equals(destination)){
if(res==null){
res=a;
continue;
}
intdiff=a.getDayOfWeek()-currenDayOfWeek;
if(diff<0)diff=diff+7;
if(diff<diffToCurrenDate){
diffToCurrenDate=diff;
res=a;
}
}
}
if(res==null){
System.out.println("Notfound");
}else{
System.out.println("日期"+newDate(System.currentTimeMillis()+TimeUnit.DAYS.toMillis(diffToCurrenDate))+":"+res.toString());
}
returnres;
}

publicvoidbooking(AirLinea,Customerc){
if(a.addBooking(c)){
System.out.println("订到了");
}else{
System.out.println("排队中");
}
}

publicvoidcancel(AirLinea,Customerc){
a.removeBooking(c);
for(Customerpre:a.getPreBooking()){
if(a.addBooking(pre)){
a.removePreBooking(pre);
System.out.println("排队的订到了");
break;
}else{
System.out.println("票余量不够当前面排队的人,下一个");
}
}
}
}

⑵ 航班信息管理 课程设计

我上学期的课程设计程序,只是只有信息检索的,但是之前有信息录入,希望能帮到你
#include<iostream>
#include<string.h>
#include<conio.h>
#include<windows.h>
/* 宏¨º定¡§义°? */
#defineMaxSpace 100
#define keylen6
#define RADIX_n10
#define RADIX_c26
#defineSHOW_MSG_ERROR "\n错误信息:航班号须由位大写字母和4位数字组成。\n输入数据错误,程序终止执行\n"
typedefchar KeyType;

typedefstruct {
charstart[6];
char end[6];
charsche[6];
chartime1[6];
chartime2[6];
charmodel[3];
intprice;
}InfoType;
typedefstruct {
KeyType keys[keylen];
InfoType others;
int next;
}SLNode;
typedefstruct {
SLNode sl[MaxSpace]; // ª
intkeynum;
intlength;
}SLList;
typedefint ArrType_n[RADIX_n];
typedefint ArrType_c[RADIX_c];
KeyTypekey[keylen],kl[4];
void Distribute(SLNode
*sl, int i, ArrType_n &f, ArrType_n
&e);
void Collect(SLNode *sl,int i, ArrType_n f, ArrType_n e);
void Distribute_c(SLNode
*sl, int i, ArrType_c &f, ArrType_c
&e);
void Collect_c(SLNode*sl, int i, ArrType_c f, ArrType_c e);
void RadixSort(SLList&L);
void Arrange(SLList&L);
int BinSearch(SLList L,KeyType key[]);
void SeqSearch(SLList L,KeyType key[],int i);
void DisplayStyle(int i, char *s);
void Display(SLList L, int i);
void searchcon(SLListL);
void Prompt( );
bool InputData(SLList&L);
bool Check_HangBanHao(char *HangBanHao);
void Distribute(SLNode*sl, int i, ArrType_n &f, ArrType_n &e)
{
int j,p;
for(j=0;j<RADIX_n;j++)
f[j]=0;

for(p=sl[0].next;p; p=sl[p].next)
{
j=sl[p].keys[i]%48;
if(!f[j])
f[j]=p;
else
sl[e[j]].next=p;
e[j]=p;
}
}

void Collect(SLNode *sl,ArrType_n f, ArrType_n e)
{
int j,t;
for(j=0;!f[j];j++);
sl[0].next=f[j];
t=e[j];
while(j<RADIX_n-1)
{
for(j=j+1;j<RADIX_n-1&& !f[j];j++);
if(f[j])
{
sl[t].next=f[j];t=e[j];
}
}
sl[t].next=0;
}
void Distribute_c(SLNode*sl, int i, ArrType_c &f, ArrType_c &e)
{
int j,p;
for(j=0;j<RADIX_c;j++)
f[j]=0;

for(p=sl[0].next;p!=0; p=sl[p].next)
{
j=sl[p].keys[i]%65;
if(!f[j])
f[j]=p;
else
sl[e[j]].next=p;
e[j]=p;
}
}
void Collect_c(SLNode*sl, ArrType_c f, ArrType_c e)
{
int j,t;
for(j=0;!f[j];j++);
sl[0].next=f[j];t=e[j]; while(j<RADIX_c-1)
{
for(j=j+1;j<RADIX_c-1&& !f[j];j++);
if(f[j])
{
sl[t].next=f[j];t=e[j];
}
}
sl[t].next=0;
}
void RadixSort(SLList&L)
{
int i;
ArrType_n fn,en;
ArrType_c fc,ec;
for(i=0;i<L.length;i++)ª
L.sl[i].next=i+1;
L.sl[L.length].next=0;
for(i=L.keynum-1;i>=2;i--)
{
Distribute(L.sl,i,fn,en);
Collect(L.sl,fn,en);
}
for(i=1;i>=0;i--)
{
Distribute_c(L.sl,i,fc,ec);
Collect_c(L.sl,fc,ec);
}
}
void Arrange(SLList&L)
{
intp,q,i;
SLNode temp;
p=L.sl[0].next;
for(i=1;i<L.length;i++)
{
while(p<i) ?
p=L.sl[p].next;
q=L.sl[p].next;
if(p!=i)
{
temp=L.sl[p];L.sl[p]=L.sl[i];L.sl[i]=temp;
L.sl[i].next=p;
}
p=q;
}
}
int BinSearch(SLList L,KeyType key[])
{ intlow,high,mid;
low=1; high=L.length;
while(low<=high){
mid=(low+high)/2;
if(strcmp(key,L.sl[mid].keys)==0)
return mid;
elseif(strcmp(key,L.sl[mid].keys)<0)
high=mid-1;
elselow=mid+1;
}
return 0;
}
void SeqSearch(SLList L,KeyType key[],int i)
{ int j,k,m=0;
for(j=1;j<=L.length;j++)
{
switch(i){
case 2:k=strcmp(key,L.sl[j].others.start);break;
case 3:k=strcmp(key,L.sl[j].others.end); break;
case 4:k=strcmp(key,L.sl[j].others.time1);break;
case5:k=strcmp(key,L.sl[j].others.time2);break;
}
if(k==0)
{
m=1;
Display(L,j);
}
}
if(m==0)
printf("很抱歉,无此航班信息\n");
}
void Display(SLList L, int i)
{
printf("航班号
起点站 终点站
航班期 起飞时间
到达时间 机型
票价\n");
DisplayStyle(6,L.sl[i].keys);DisplayStyle(7, L.sl[i].others.start);
DisplayStyle(7,L.sl[i].others.end);DisplayStyle(7, L.sl[i].others.sche);
DisplayStyle(9,L.sl[i].others.time1);DisplayStyle(9, L.sl[i].others.time2);
DisplayStyle(5, L.sl[i].others.model);printf("%6d\n",L.sl[i].others.price);
printf("\n");
}
void DisplayStyle(int i, char *s)
{
int j;
i -= strlen(s);
for(j=0;j<i; ++j)
printf(" ");
printf("%s,",s);
}
void searchcon(SLList L)
{
inti=1,k;
while(i>=1&& i<=6){
printf("\n请选择命令代号(0----6): ");
scanf("%d",&i);
switch(i){
case
1: printf("输入要查询的航班号(字母要大写):
");
scanf("%s", key);k=BinSearch(L, key);
if(k)
Display(L,k);
else
printf("很抱歉,无此航班信息\n");
break;
case2: printf("输入要查询的航班起点站?名: ");
scanf("%s", key); SeqSearch(L, key, i);
break;
case3: printf("输入要查询的航班终点站名: ");
scanf("%s",key); SeqSearch(L, key, i);
break;
case4: printf("输入要查询的航班起飞时间: ");
scanf("%s",kl); SeqSearch(L, kl, i);
break;
case5: printf("输要查询的航班到达时间: ");
scanf("%s",kl); SeqSearch(L, kl, i);
break;
case6: printf("请依次录航班信息数据Y:\n");
InputData(L);
break;
case0: printf("再见^_^");
exit(0);
}
Prompt( );
}
}
bool InputData(SLList &L)
{
int i=++L.length;
char yn='y';
printf("\n请依次录入航班信息数据(航班号由2位大写字母和4位数字组成:");
do
{
printf("\n航班号
起点站 终点站
航班期 起飞时间
到达时间 机型 票价\n");
scanf("%s%s%s%s%s%s%s%d",L.sl[i].keys, L.sl[i].others.start,
L.sl[i].others.end, L.sl[i].others.sche,L.sl[i].others.time1,
L.sl[i].others.time2, L.sl[i].others.model,&L.sl[i].others.price);
fflush(stdin);
if(!Check_HangBanHao(L.sl[i].keys))
returnfalse;
++i;
printf("继续输入吗 y/n:");
}
while((yn=getche( ))=='y'|| yn=='Y');
printf("\n");
L.length = i-1;
RadixSort(L);
Arrange(L);
returntrue;
}
bool Check_HangBanHao(char *HangBanHao)
{
if(strlen(HangBanHao) != 6)
returnfalse;
elseif (HangBanHao[0]<'A'|| HangBanHao[0]>'Z'
|| HangBanHao[1]<'A' || HangBanHao[1]>'Z')
returnfalse;
for(int i=2; i<=5; i++)
{
if(HangBanHao[i]<'0' || HangBanHao[i]>'9')
returnfalse;
}
returntrue;
}
void Prompt( )
{
printf("***************************************************\n");
printf(" *
航班信息查询与检索系统
*\n");
printf(" * 1.航 班 号 *\n");
printf(" * 2.起 点 站 *\n");
printf(" * 3.终 点 站 *\n");
printf(" * 4.起 飞 时 间 *\n");
printf(" * 5.到 达 时 间 *\n");
printf(" * 6.添 加 班 次 *\n");
printf(" * 0.退 出 系 统 *\n");
printf("***************************************************\n");
}
int main( )
{
SLList L;
L.keynum=6;L.length=0;
if(!InputData(L))
{
printf(SHOW_MSG_ERROR);
return1;
}
Prompt( );
searchcon(L);
return 0;

⑶ 用C语言写字符界面的飞机订票系统(课程设计),想在主界面上弄一个好看的界面。怎样弄

直接输出puts("字符串");或者("字符串");
要多行输出时记得加\
例如
printf(" \
\
, \
_/(( \
_.---. .' `\ \
.' ` ^ T= \
/ \ .--' \
| / )'-. \
; , <__..-( '-.) \
\ \-.__) ``--._) \
'.'-.__.-. \
'-...-'?);

右边的\表示换行输出是格式控制符。但是你要控制好每行输出字符个数否则图案每行位置很难对齐

⑷ c语言课程设计飞机选座位

又按你的新要求改了一下
还有二题也做了修改这次
因该是你想要的答案了:
一题:
#include<stdio.h>
void main()
{
int i,n,j,a;char c;
scanf("%d",&n);
a=n-1;
for(i=1;i<=n;i++,a--)
{
for(j=1;j<=a;j++)
printf("%c",' ');
for(c='A';c<'A'+i;c++)
printf("%c",c);
for(c=c-2;c>='A';c--)
printf("%c",c);
printf("\n");
}
}
二题:
#include<stdio.h>
void main()
{
void print(int *p[50],char *q[50],int n);
int n,i,j; int a[50][4];char str[50][10];
int *p[50]; char *q[50];
scanf("%d",&n);
getchar();
for(i=0;i<n;i++)
{
gets(str[i]);
for(j=0;j<4;j++)
{
scanf("%d",&a[i][j]);
getchar();
}
}
for(i=0;i<n;i++)
{
p[i]=a[i];
q[i]=str[i];
}
print(p,q,n);
}
void print(int *p[50],char *q[50],int n)
{
int i,j; int *q2; char *q1;
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
if(*(*(p+i)+3)<*(*(p+j)+3))
{
q2=p[i];
p[i]=p[j];
p[j]=q2;
q1=q[i];
q[i]=q[j];
q[j]=q1;
}
printf("unmber name score1score2score3 sum\n");
for(i=0;i<n;i++)
{
printf("%-6d %-10s ",i+1,*(q+i));
for(j=0;j<4;j++)
printf("%-6d",*(*(p+i)+j));
printf("\n");
}
}

⑸ 数据结构课程设计……关于飞机票系统 哪位高手帮我做做啊

汗,难道这个课的老师不能换点题材吗?当年我们也是写这个,还要答辩.....
用VB写下很简单的啊楼主,看你的要求还没涉及到网络联机...当初我们写的时候要求最少2电脑,一台写服务器,一台写客户端,实现查询、定退票....权限等等....比较烦,你这个自己写下吧!

建议最少给100分,可能有人会帮你写,即便是这样的功能,少说也有1000行代码了!

⑹ 数据结构课程设计——飞机订票系统

#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);
}

⑺ 飞机制造技术专业的课程设置

主要来课程:现代制图、工程力学、自航空工程材料、公差配合与测量技术、飞机构造、机械设计基础、机械制造工艺学、机床夹具设计、飞机零件加工与成型工艺、机械加工设备、液压传动、制图测绘、机加工实习、数控实训、机械设计技能实训、飞机零件加工与成型工艺课程设计、数控加工与编程、电工电子技术、专业英语、机械设备维修工艺学、特种加工技术。

⑻ 关于课程设计

给你一份我的课程设计吧。知道你在

热点内容
武汉大学学生会辅导员寄语 发布:2021-03-16 21:44:16 浏览:612
七年级学生作文辅导学案 发布:2021-03-16 21:42:09 浏览:1
不屑弟高考成绩 发布:2021-03-16 21:40:59 浏览:754
大学毕业证会有成绩单 发布:2021-03-16 21:40:07 浏览:756
2017信阳学院辅导员招聘名单 发布:2021-03-16 21:40:02 浏览:800
查询重庆2018中考成绩查询 发布:2021-03-16 21:39:58 浏览:21
结业考试成绩怎么查询 发布:2021-03-16 21:28:40 浏览:679
14中医医师资格笔试考试成绩查分 发布:2021-03-16 21:28:39 浏览:655
名著赏析课程标准 发布:2021-03-16 21:27:57 浏览:881
北京大学商业领袖高端培训课程 发布:2021-03-16 21:27:41 浏览:919