主题:数据结构课程设计C描述 民航售票处的服务系统 源代码200行左右
xhtxht
[专家分:0] 发布于 2005-02-24 10:29:00
[问题描述]
设民航售票处的服务系统提供下列服务:
(1)查询航线:顾客提出终点站输出下列信息:
航班号.飞机号,星期几飞行,最近一天航班的日期和余票额.
(2)订票业务;据顾客要求(航班号,订票额)查询该航班票额情况,若有余票,办理售票手续,输出座位号;若已满员或票额不足,则另询顾客要求.若需要,可预约登记排队等候.
(3)退票业务:根据顾客情况(日期,航班)为顾客办理退票手续,然后查询该航班是否有人预约登记,首先询问排在第一位的顾客,若退票额能满足他的要求,则为他办理退票手续,否则依次询问其他排队预约的顾客.
回复列表 (共144个回复)
111 楼
appleandsmile2004 [专家分:0] 发布于 2006-09-19 11:04:00
我也要啊,发给我的邮箱:appleandsmile2004@yahoo.com.cn
谢谢啊!
112 楼
ldlxhb [专家分:0] 发布于 2006-09-23 14:13:00
请给偶也发一份,偶正等着毕业设计.
邮箱:ldlxhb@163.com
113 楼
newboy264 [专家分:0] 发布于 2006-09-27 11:29:00
给我发一个啊 我也在专严哦 email :newboy2647@163.com
114 楼
sunyoo [专家分:0] 发布于 2006-12-28 10:43:00
我也想学习学习
谢谢楼主啊,
我邮箱 59529209@qq.com
115 楼
sunyoo [专家分:0] 发布于 2006-12-28 10:44:00
给偶也发一个吧:)
59529209@qq.com
谢谢楼主了
116 楼
roader2046 [专家分:0] 发布于 2006-12-28 16:01:00
我没选这个题目,但我在网上找到了源代码:
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#define OK 1
#define ERROR 0
typedef struct airline{
char air_num[8];
char plane_num[8];
char end_place[20];
int total;
int left;
struct airline *next;
}airline;
typedef struct customer{
char name[8];
char air_num[8];
int seat_num;
struct customer *next;
}customer;
airline *start_air()
{
airline *a;
a=(airline*)malloc(sizeof(airline));
if(a==NULL)
a->next=NULL;
return a;
}
customer *start_cus()
{
customer *c;
c=(customer*)malloc(sizeof(customer));
if(c==NULL)
c->next=NULL;
return c;
}
airline *modefy_airline(airline *l,char *air_num)
{
airline *p;
p=l->next;
for(;p!=NULL;p=p->next)
{
if(strcmp(air_num,p->air_num)==0)
{
p->left++;
return l;
}
printf("NO the airline!");
return 0;
}
}
int insert_air(airline **p,char *air_num,char *plane_num,char *end_place,int total,int left)
{
airline *q;
q=(airline*)malloc(sizeof(airline));
strcpy(q->air_num,air_num);
strcpy(q->plane_num,plane_num);
strcpy(q->end_place,end_place);
q->total=total;
q->left=left;
q->next=NULL;
(*p)->next=q;
(*p)=(*p)->next;
return OK;
}
int insert_cus(customer **p,char *name,char *air_num,int seat_num)
{
customer *q;
q=(customer*)malloc(sizeof(customer));
strcpy(q->name,name);
strcpy(q->air_num,air_num);
q->seat_num=seat_num;
q->next=NULL;
(*p)->next=q;
(*p)=(*p)->next;
return OK;
}
int book(airline *a,char *air_num,customer *c,char *name)
{
airline *p=a;
customer *q=c->next;
p=a->next;
for(;q->next!=NULL;q=q->next){}
for(;p->next!=NULL;p=p->next)
{
if(p->left>0)
{
printf("Your seat number is %d",(p->total-p->left+1));
insert_cus(&q,name,air_num,p->total-p->left+1);
p->left--;
return OK;
}
else
{
printf("seat is full");
return 0;
}
}
}
117 楼
roader2046 [专家分:0] 发布于 2006-12-28 16:01:00
接上面
int del_cus(customer *c,airline *l,char *name)
{
customer *p,*pr;
char air_num[8];
pr=c;
p=pr->next;
while(p!=NULL)
{
if(strcmp(p->name,name)==0)
{
strcpy(air_num,p->air_num);
l=modefy_airline(l,air_num);
pr->next=p->next;
p=pr->next;
printf("finish!");
return OK;
}
pr=pr->next;
p=pr->next;
}
printf("NO the customer!");
return ERROR;
}
int search_air(airline *head)
{
airline *p=head->next;
printf("air_num plane_num end_place total left\n");
for(;p!=NULL;p=p->next)
{
printf("%s %-10s %-8s %-8d%-8d\n",p->air_num,p->plane_num,p->end_place,p->total,p->left);
}
return OK;
}
int search_cus(customer *head)
{
struct customer *q=head->next;
printf("name air_num seat_num\n");
for(;q!=NULL;q=q->next)
{
printf("%-8s%-12s%-d\n",q->name,q->air_num,q->seat_num);
}
return OK;
}
int creat_air(airline **l)
{
airline *p=*l;
int i=0;
char *air_num[3]={"007af","008af","009af"};
char *plane_num[3]={"plane1","plane2","plane3"};
char *end_place[3]={"Beijing","Shanghai","Tianjin"};
int total[3]={100,100,100};
int left[3]={52,54,76};
for(i=0;i<3;i++)
insert_air(&p,air_num[i],plane_num[i],end_place[i],total[i],left[i]);
return OK;
}
118 楼
roader2046 [专家分:0] 发布于 2006-12-28 16:01:00
继续接:
int creat_cus(customer **l)
{
customer *p=*l;
int i=0;
char *name[3]={"zhsan","lisi","wangwu"};
char *air_num[3]={"007af","008af","009af"};
int seat_num[3]={2,5,7};
for(i=0;i<3;i++)
insert_cus(&p,name[i],air_num[i],seat_num[i]);
return OK;
}
void main()
{
int t=1;
customer *cus=start_cus();
airline *air=start_air();
char name[8],air_num[8],ch;
creat_air(&air);
creat_cus(&cus);
while(t==1)
{
printf("\n");
printf("*********************************\n");
printf("* Welcome to air firm! *\n");
printf("* book--------1 *\n");
printf("* cancel------2 *\n");
printf("* search------3 *\n");
printf("* exit--------4 *\n");
printf("*********************************\n");
ch=getchar();
if(ch=='1')
{
printf("Please input a airline number:");
scanf("%s",air_num);
printf("Please input a name:");
scanf("%s",name);
book(air,air_num,cus,name);
}
else
if(ch=='2')
{
printf("Please input the cancel name:");
scanf("%s",name);
del_cus(cus,air,name);
}
else
if(ch=='3')
{
search_air(air);
printf("\n");
search_cus(cus);
}
else
if(ch=='4')
{
t=0;
}
}
}
119 楼
liumanrong [专家分:0] 发布于 2007-04-01 21:52:00
能发给我个吗?我也学这个的 liumanrong_527@126.com 这是我的邮箱
120 楼
bpttc [专家分:8790] 发布于 2007-04-01 23:06:00
好老的帖子都被顶起来 让我看见了生财之道....源代码可以用rmb换 wkakaka
我来回复