求高人帮帮忙....感谢啊~~~
帮做一下啊 TC的 飞机定票系统,完成以下设计:
l 定义相应的数据结构,设计一个简单的菜单;
l 完成旅客定票模块;
l 输出旅客飞机票;
l 完成旅客退票模块;
l 完成航班查询模块;
保存定票信息。
#include<stdio.h>
#include<graphics.h>
#include<process.h>
#include<string.h>
#include<conio.h>
typedef struct plane /*定义航班信息*/
{ char ID[10]; /*航班代号*/
char Start_Place[10];
char End_Place[10];
int price;
int Buy_num;
char time[20];
}PLANE;
PLANE s[100]; /*乘客定票信息*/
/*清屏并显示题目*/
void page_title(char *menu_item)
{
printf("\n\n\t\t******** Link Operation ********\n\n \t\t\t\t%s\n\n",menu_item);
}
/*乘客定票*/
BOOK()
{
}
/*输出飞机票*/
PRINT( )
{
}
/*乘客退票*/
Back()
{
}
/*输入航班号,查询航班信息*/
Query()
{
}
/*将定票信息存入到文件中*/
save()
{
}
menu() /*菜单函数*/
{ int choice;
menu: page_title("--menu--\n");
printf("\t\t\t1.Book a plane ticket\n");
printf("\t\t\t2.Print a plane ticket\n");
printf("\t\t\t3.Back a ticket\n");
printf("\t\t\t4.Query plane's informations\n");
printf("\t\t\t5.Save Book's informations\n");
printf("\t\t\t0.Quit system\n\n\n");
printf("\t\t\tPlease enter choice(0~5)");
scanf("%d",&choice);
switch(choice)
{
case 1:BOOK();break;
case 2:PRINT();break;
case 3:Back();break;
case 4:Query();break;
case 5:save();break;
case 0:exit(0);
}
if(choice<0||choice>5)printf("\n\n\n\t\tplease choose again!\n\n");
goto menu;
}
/*欢迎界面(图形模式)*/
welcome()
{int graphdriver=DETECT,graphmode;
int i,m;
char s[]={"Welcome"};
char d[]={" TEACHER"};
char f[]={" HeHong!"};
initgraph(&graphdriver,&graphmode,"c:\\tc");
setbkcolor(LIGHTBLUE);
setfillstyle(1,RED);
bar(225,20,415,60);
bar(60,80,100,420);
bar(540,80,580,420);
setfillstyle(1,YELLOW);
bar(257,100,383,120);
bar(257,360,383,380);
setlinestyle(0,0,3);
setcolor(RED);
circle(320,240,120);
setfillstyle(1,LIGHTRED);
setcolor(LIGHTRED);
pieslice(320,240,0,360,118);
setcolor(YELLOW);
setlinestyle(0,0,3);
for(i=260;i<=380;i+=8)
{
line(i,380,i,440);
}
settextstyle(1,0,5);
outtextxy(240,145,s);
outtextxy(220,210,d);
outtextxy(245,275,f);
getch();
closegraph();
}
/*主函数*/
main()
{
welcome();
menu();
}