文章目录

  • 题目
  • 总体设计和需求分析
    • 设计目的
    • 总体设计和功能
    • 结构体设计
      • 机票信息结构体
      • 订票人信息结构体
    • 主函数的设计
  • 各功能代码的实现
    • 前置
    • 添加机票
    • 查找机票信息
    • 修改机票信息
    • 显示机票信息
    • 推荐机票信息
    • 订票
    • 退票
    • 保存信息
    • 显示时间
  • 测试

题目

本文将设计一个飞机订票系统,主要包括机票的添加、修改、查找、订票、退票、推荐机票功能,用C语言编程实现,并用链表存储产生的航班信息和订票信息数据,最后可以把链表中的数据保存到文件中。

总体设计和需求分析

设计目的

1.怎样去合理的设计一个数据结构来存储订票信息和航班信息
2.加深对链表的增删改查功能的学习和理解
3.学习如何链表和外部文件之间的读取和存储操作
4.学习如何将学到的知识应用到实际的问题中

总体设计和功能

此飞机订票系统将实现以下功能:
1.初始化功能
  该功能将实现将航班信息文件和订票人订票信息文件中的数据读取到链表中。
2.添加机票信息功能
  该功能将实现添加航班机票信息,信息包括航班号、出发地、目的地、起飞时间、降落时间、票价、折扣、剩余票数,然后用链表将数据保存起来。
3.查询机票信息功能
  该功能将实现通过航班号来查询机票信息的功能
4.修改机票信息功能
  该功能将通过航班号调用查找机票信息功能,定位到要修改的航班信息上,然后通过航班信息子菜单确定要修改的某一项航班信息。
5.显示机票信息
  该功能将实现把所有航班信息显示出来
7.推荐机票功能
  该功能将实现通过输入目的地,和乘客最早出发时间可以获得符合条件的航班信息
8.订票功能
  该功能下乘客输入目的地,并且输入订票人的姓名、身份证号码、性别、购票数量、订购航班号以实现用户订票功能
9.退票功能
  该功能下乘客可以订购的机票进行退回。
10.显示时间功能
  该功能可以显示实时时间
11.保存信息功能
该功能下可以把链表中的信息保存到文件中。

结构体设计

我们将定义两个结构体,分别为机票信息结构体和订票人信息结构体

机票信息结构体
typedef struct AirPlane
{char acFlight[20];//航班号char acOrigin[10]; //出发地char acDest[20];  //目的地char acTakeOffTime[10]; //起飞时间char acReverceTime[10]; //降落时间float fPrice;  //票价char acDisscount[4];  //折扣int iNum;  //剩余票数
}AirPlane, * PAirPlane;
//定义机票信息节点的结构体
typedef struct PlaneNode
{struct AirPlane stDate;struct PlaneNode* pstNext;}PlaneNode, * PPlaneNode;
订票人信息结构体
typedef struct Man
{char acName[20];  //姓名char acID[20];   //身份证号码char acSex[10];   //性别 int  iBookNum;   //购票数量char acBookFilght[10];  //订购航班号
}Man, * PMan;
//订票人信息节点的结构体
typedef struct ManNode
{struct Man stDate;struct ManNode* pstNext;
}ManNode, * PManNode;

主函数的设计

在主函数中,首先将通过初始化函数把文件中的数据读取到链表中,然后可以通过switch选择用户在飞机订票系统中需要执行的操作

//作为数据改动的标志
int iSave = 0;int main()
{struct PlaneNode pstPlaneNodeHead;  //机票信息头结点pstPlaneNodeHead.pstNext = NULL;struct ManNode pstManNodeHead;    //购票信息头结点pstManNodeHead.pstNext = NULL;Init(&pstPlaneNodeHead, &pstManNodeHead);  // 将文件的数据加载到内存中int iSel = 0; //用于接收用户对功能的选择char c1;while (1){system("cls");Menu();printf("Input 0-9 operations:");scanf_s("%d", &iSel);getchar();switch (iSel){case 1:printf("进入添加机票页面\n");Insert(&pstPlaneNodeHead); // 添加机票信息break;case 2:Search(&pstPlaneNodeHead);   //查询机票信息break;case 3:Book(&pstPlaneNodeHead, &pstManNodeHead);//订票break;case 4:Modify(&pstPlaneNodeHead);    //修改机票信息break;case 5:Show(&pstPlaneNodeHead);   //显示机票信息  break;case 6:Recommend(&pstPlaneNodeHead);  //推荐机票信息break;case 7:Refund(&pstPlaneNodeHead, &pstManNodeHead);//退票信息break;case 8:NowTime();//显示当前时间break;case 9:SaveMan(&pstManNodeHead);     //数据保存SavePlane(&pstPlaneNodeHead);break;case 0:if (iSave == 1){printf("do you want to save (y/n)");scanf("%c", &c1);getchar();if (c1 == 'y' || c1 == 'Y'){SaveMan(&pstManNodeHead);     //保存订票人的信息SavePlane(&pstPlaneNodeHead);    // 保存机票信息}}Destroy(&pstPlaneNodeHead, &pstManNodeHead);return 0;}printf("\nplease press any key to continue...\n");_getch();}Destroy(&pstPlaneNodeHead, &pstManNodeHead);return 0;
}

各功能代码的实现

前置

写入需要用到的头文件、宏定义以及其中的打印函数等等

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
#include<Windows.h>
#include<malloc.h>
#include<string.h>
#include<conio.h>
#include <time.h>#define HEAD1 "*******************************************************************\n"
#define HEAD2 "|Flight|StartCity|DestCity|DepertureTime|Arrival|  price   |number|\n"
#define HEAD3 "|------|---------|--------|-------------|-------|----------|------|\n"
#define FORMET  "%-9s%-9s%-10s%-14s%-10s%-2.2f%6d\n"
#define DATA  pst->stDate.acFlight,pst->stDate.acOrigin,pst->stDate.acDest,pst->stDate.acTakeOffTime,pst->stDate.acReverceTime,pst->stDate.fPrice,pst->stDate.iNum```c
//主菜单
void Menu()
{puts("**********************************************************************");puts("****** Welcome to the airplane tickets booking system");puts("----------------------------------------------------------------------");puts("                    choose the follow operation(0-9)                 *");puts("--------------------------------------------------------------------- ");puts("***********      1 Insert  flights              2 Search  flights     ");puts("**********       3 Book tickets                 4 Modify  fligts  date");puts("**********       5 Show flights                 6 Recommend flights   ");puts("************     7 Refund tickets               8 Show current time   ");puts("***********      9 Save to files                0 quit                ");puts("**********************************************************************");
}
//打印函数
void PrintHead()
{printf(HEAD1);printf(HEAD2);printf(HEAD3);
}void PrintDate(PPlaneNode stLP)
{PPlaneNode pst = stLP;printf(FORMET, DATA);}
//销毁函数  防止内存泄漏
void Destroy(PPlaneNode pstPlaneNodeHead, PManNode pstManNodeHead)
{assert(pstManNodeHead != NULL);assert(pstPlaneNodeHead != NULL);PPlaneNode p = pstPlaneNodeHead->pstNext;PManNode q = pstManNodeHead->pstNext;while (p != NULL){PPlaneNode tmp = p;p = p->pstNext;free(tmp);}while (q != NULL){PManNode tmp = q;q = q->pstNext;free(tmp);}}

#### 初始化```c
int Init(struct PlaneNode* pstPlaneNodeHead, struct ManNode* pstManNodeHead)
{//先加载飞机机票信息FILE* pfPlane; //定义飞机机票信息文件指针struct PlaneNode* pstPlaneNodeTemp, * pstPlaneNodeCur;pstPlaneNodeCur = pstPlaneNodeHead;pstPlaneNodeTemp = NULL;pfPlane = fopen("plane.txt", "ab+");if (pfPlane == NULL){printf("can't  open plane.txt!\n");return -1;}else{//把文件数据读入到链表中while (!feof(pfPlane)) //读到文件最后一个数据{pstPlaneNodeTemp = (struct PlaneNode*)malloc(sizeof(struct PlaneNode));if (fread(pstPlaneNodeTemp, sizeof(struct PlaneNode), 1, pfPlane) !=0){pstPlaneNodeTemp->pstNext = NULL;pstPlaneNodeCur->pstNext = pstPlaneNodeTemp;pstPlaneNodeCur = pstPlaneNodeTemp;}}free(pstPlaneNodeTemp);  //此时,释放的是文件读完后最后一次申请的指针fclose(pfPlane);}//加载订票人信息FILE* pfMan;  // 定义订票人信息文件指针struct ManNode* pstManNodeTemp, * pstManNodeCur;pstManNodeCur = pstManNodeHead;pstManNodeTemp = NULL;pfMan = fopen("man.txt", "ab+");if (pfMan == NULL){printf("can't open  man.txt!\n");return -1;}else{while (!feof(pfMan)){pstManNodeTemp = (struct ManNode*)malloc(sizeof(struct ManNode));if (fread(pstManNodeTemp, sizeof(struct ManNode), 1, pfMan) == 1){pstManNodeTemp->pstNext = NULL;pstManNodeCur->pstNext = pstManNodeTemp;pstManNodeCur = pstManNodeTemp;}}free(pstManNodeTemp);fclose(pfMan);}return 0;
}

添加机票

void Insert(struct PlaneNode* pstPlaneNodeHead)
{assert(pstPlaneNodeHead != NULL);if (pstPlaneNodeHead == NULL){return;}struct PlaneNode* pstNode, * pstHead, * pstTail, * pstCur, * pstNew;char acFlight[20];  //保存航班号pstHead = pstTail = pstPlaneNodeHead;//让pstTail指向最后一个节点while (pstTail->pstNext != NULL){pstTail = pstTail->pstNext;}while (1){printf("Input the flight number (-1 to end):");scanf_s("%s", acFlight, 20);getchar();if (strcmp(acFlight, "-1") == 0){break;}//航班号唯一pstCur = pstPlaneNodeHead->pstNext;while (pstCur != NULL){if (strcmp(acFlight, pstCur->stDate.acFlight) == 0){printf("this flight %s esists!\n", acFlight);return;}pstCur = pstCur->pstNext;}//如果航班号没有和现有记录航班号重复 ,则重新建一个链表节点pstNew = (struct PlaneNode*)malloc(sizeof(struct PlaneNode));strcpy_s(pstNew->stDate.acFlight, 20, acFlight);printf("Input the Start City:\n");scanf_s("%s", pstNew->stDate.acOrigin, 10);printf("Input the Dest City:\n");scanf_s("%s", pstNew->stDate.acDest, 20);printf("Input the Departure time(Format 00:00):\n");scanf_s("%s", pstNew->stDate.acTakeOffTime, 10);printf("Input the Arrival time(Format 00:00):\n");scanf_s("%s", pstNew->stDate.acReverceTime, 10);printf("Input the Price of ticket:\n ");scanf_s("%f", &pstNew->stDate.fPrice);printf("Input the discount(Fromat(0.0):\n");scanf_s("%s", pstNew->stDate.acDisscount, 4);printf("Input the number of the tickets:\n");scanf_s("%d", &pstNew->stDate.iNum);pstNew->pstNext = NULL;pstTail->pstNext = pstNew;pstTail = pstNew;//如果有新的航班信息,保存标准置为1,若退出需要提示是否保存信息(见主函数)iSave = 1;}
}

查找机票信息

//查询机票信息
void Search(PPlaneNode pstPlaneNodeHead)
{assert(pstPlaneNodeHead != NULL);if (pstPlaneNodeHead == NULL){return;}system("cls");int iSel = 0;int icount = 0;PPlaneNode pstPlaneNodeCur = pstPlaneNodeHead->pstNext;if (pstPlaneNodeCur == NULL){printf("No flight record");return;}printf("Choose one way according to:\n 1.flight  2.Dest:\n");scanf_s("%d", &iSel);if (iSel == 1){char acFlight[20];printf("请输入要查询的航班号:\n");scanf_s("%s", &acFlight, 20);getchar();//打开订票信息文件for (pstPlaneNodeCur; pstPlaneNodeCur != NULL; pstPlaneNodeCur = pstPlaneNodeCur->pstNext){if (strcmp(pstPlaneNodeCur->stDate.acFlight, acFlight) == 0){PrintHead();PrintDate(pstPlaneNodeCur);break; //航班号唯一,查到就退出}}}else if (iSel == 2){char acDest;printf("Input the Dest City:\n");scanf_s("%s", &acDest, 20);PrintHead();for (pstPlaneNodeCur; pstPlaneNodeCur != NULL; pstPlaneNodeCur = pstPlaneNodeCur->pstNext){if (strcmp(pstPlaneNodeCur->stDate.acDest, &acDest) == 0){PrintDate(pstPlaneNodeCur);icount++;  //同一个目的地可能有多个数据}}if (icount == 0)  //遍历完一遍,记录数为0,则没有记录:{printf("Sorry ,no record!\n");}}else{printf("sorry please input right number1-2");}}

修改机票信息

void Mod_menu()
{puts("**********************************************************************");puts("----------------------------------------------------------------------");puts("                    choose the follow operation(0-8)                  ");puts("--------------------------------------------------------------------- ");puts("*******************       1   flights          ********************   ");puts("*******************       2   Origin           ********************   ");puts("*******************       3   Destination      ********************   ");puts("*******************       4   Take off time    ********************   ");puts("*******************       5   Reverce time     ********************   ");puts("*******************       6   Prices           ********************   ");puts("*******************       7   Disscount        ********************   ");puts("*******************       8   ticket number    ********************   ");puts("*******************       0   quits            ********************   ");puts("**********************************************************************");
}
void Modify(PPlaneNode pstPlaneNodeHead)
{assert(pstPlaneNodeHead != NULL);if (pstPlaneNodeHead == NULL){return;}char acFlight[20];PPlaneNode pstPlaneNodeCur = pstPlaneNodeHead->pstNext;if (pstPlaneNodeCur == NULL){printf("No flight to modifty!\n");return;}else{printf("Input the flight number you want to modify:\n");scanf_s("%s", acFlight, 20);for (pstPlaneNodeCur; pstPlaneNodeCur != NULL; pstPlaneNodeCur = pstPlaneNodeCur->pstNext){if (strcmp(pstPlaneNodeCur->stDate.acFlight, acFlight) == 0){break;}}if (pstPlaneNodeCur){//子菜单int isel = 0;system("cls");Mod_menu();printf("please Input 0-8: ");scanf_s("%d", &isel);getchar();switch (isel){case 1:printf("Input new flights!\n");scanf("%s", pstPlaneNodeCur->stDate.acFlight);break;case 2:printf("Input new Origin!\n");scanf("%s", pstPlaneNodeCur->stDate.acOrigin);break;case 3:printf("Input new Destination!\n");scanf("%s", pstPlaneNodeCur->stDate.acDest);break;case 4:printf("Input new Take off time!\n");scanf("%s", pstPlaneNodeCur->stDate.acTakeOffTime);break;case 5:printf("Input new Reverce time!\n");scanf("%s", pstPlaneNodeCur->stDate.acReverceTime);break;case 6:printf("Input new Prices!\n");scanf("%f", &pstPlaneNodeCur->stDate.fPrice);break;case 7:printf("Input new Disscount!\n");scanf("%s", pstPlaneNodeCur->stDate.acDisscount);break;case 8:printf("Input new ticket number!\n");scanf("%d", &pstPlaneNodeCur->stDate.iNum);break;case 0:printf("quit!\n");break;}printf("End Modifying information!\n");}else{printf("flights number not exist!\n");}}}

显示机票信息

void Show(PPlaneNode pstPlaneNodeHead)
{assert(pstPlaneNodeHead != NULL);PPlaneNode pstPlaneNodeCur = pstPlaneNodeHead->pstNext;PrintHead();if (pstPlaneNodeHead->pstNext == NULL){printf("no flight ticket!\n");}else{while (pstPlaneNodeCur != NULL){PrintDate(pstPlaneNodeCur);pstPlaneNodeCur = pstPlaneNodeCur->pstNext;}}
}

推荐机票信息

struct ManNode* FindMan(PManNode pstManNodeHead, char acId[20]){PManNode pstManNodeCur = pstManNodeHead->pstNext;for (pstManNodeCur; pstManNodeCur != NULL; pstManNodeCur = pstManNodeCur->pstNext){if (strcmp(pstManNodeCur->stDate.acID, acId) == 0) // 知道到id号相同的订票人的{return pstManNodeCur;}}return NULL;
}PPlaneNode FindPlane(PPlaneNode pstPlaneNodeHead, char* acBookFlight)
{PPlaneNode pstPlaneNodeCur = pstPlaneNodeHead->pstNext;for (pstPlaneNodeCur; pstPlaneNodeCur != NULL; pstPlaneNodeCur = pstPlaneNodeCur->pstNext){if (strcmp(pstPlaneNodeCur->stDate.acFlight, acBookFlight) == 0) // 知道到id号相同的订票人的{return pstPlaneNodeCur;}}return NULL;
}
void Recommend(PPlaneNode pstPlaneNodeHead)
{//推荐给用用户合适的机票//时间 地点PPlaneNode pstPlaneNodeCur;char acDest[20];char acTime[10];int iNum = 0;pstPlaneNodeCur = pstPlaneNodeHead->pstNext;printf("Input your destination");scanf_s("%s", acDest, 20);printf("Input the earlist time you can take:");scanf_s("%s", acTime, 10);PrintHead();for (pstPlaneNodeCur; pstPlaneNodeCur != NULL; pstPlaneNodeCur = pstPlaneNodeCur->pstNext){if (strcmp(pstPlaneNodeCur->stDate.acDest, acDest) == 0){if (strcmp(acTime,pstPlaneNodeCur->stDate.acTakeOffTime) < 0){PrintDate(pstPlaneNodeCur);iNum++;}}}}

订票

void Book(PPlaneNode pstPlaneNodeHead, PManNode pstManNodeHead)
{//接收订票人头指针PPlaneNode pstPlaneNodeCur, astPlaneNode[10];PManNode pstManNodeCur, astManNodeTemp = NULL;char acDest[20];char acId[20];char acName[20];char acSex[10];char acDecision[2];char  acFlight[20];int iNum = 0;int iRecord = 0;int k = 0;char iFlag = 0;pstManNodeCur = pstManNodeHead;for (pstManNodeCur; pstManNodeCur->pstNext != NULL; pstManNodeCur = pstManNodeCur->pstNext);//将订票人结构体指向尾巴//输入目的地printf("please Input Dest City:\n");scanf_s("%s", &acDest, 20);getchar();//查找目的地 存入结构体数组中pstPlaneNodeCur = pstPlaneNodeHead->pstNext;for (pstPlaneNodeCur; pstPlaneNodeCur != NULL; pstPlaneNodeCur = pstPlaneNodeCur->pstNext){if (strcmp(pstPlaneNodeCur->stDate.acDest, acDest) == 0){astPlaneNode[iRecord] = pstPlaneNodeCur;iRecord++;}}printf("\n there are %d flight you can choose! \n", iRecord);PrintHead();for (k = 0; k < iRecord; k++){PrintDate(astPlaneNode[k]);}if (iRecord == 0){printf("sorry ,No flights you can book ! \n");}else{printf("do you want to book it?(y(Y)/n(N))");scanf_s("%s", acDecision, 2);getchar();if (strcmp(acDecision, "y") == 0 || strcmp(acDecision, "Y") == 0){printf("Input your information ! \n");astManNodeTemp = (PManNode)malloc(sizeof(ManNode));//assertprintf("Input your Name :\n");scanf_s("%s", acName, 20);strcpy(astManNodeTemp->stDate.acName, acName);printf("Input your Id: \n");scanf_s("%s", acId, 20);strcpy(astManNodeTemp->stDate.acID, acId);printf("Input your sex(M/F) : \n");scanf_s("%s", acSex, 10);strcpy(astManNodeTemp->stDate.acSex, acSex);printf("Input your Flights :\n");scanf_s("%s", acFlight, 20);strcpy(astManNodeTemp->stDate.acBookFilght, acFlight);for (k = 0; k < iRecord; k++){if (strcmp(astPlaneNode[k]->stDate.acFlight, acFlight) == 0){if (astPlaneNode[k]->stDate.iNum < 1){printf("No tickets!");return;}printf("return %d tickets!\n", astPlaneNode[k]->stDate.iNum);iFlag = 1;break;}}if (iFlag == 0){printf("error");return;}printf("Input the book number: \n"); //订购几张票scanf_s("%d", &iNum);astPlaneNode[k]->stDate.iNum = astPlaneNode[k]->stDate.iNum - iNum;  //还剩下的票数astManNodeTemp->stDate.iBookNum = iNum;  //订购票数pstManNodeCur->pstNext = astManNodeTemp;  //链接链表astManNodeTemp->pstNext = NULL;pstManNodeCur = astManNodeTemp;   //移动当前链表指针位置printf("Finish Book!\n");}}
}

退票

//退票
void Refund(PPlaneNode pstPlaneNodeHead, PManNode pstManNodeHead)
{PManNode pstManNodeCur, pstManNodeFind = NULL;PPlaneNode pstPlaneNodeFind = NULL;char acId[20];char acDecision[2];int iNum = 0; //剩余票数int iBookNum;  ////找到订票人的结构体printf("Input your Id!\n");scanf_s("%s", acId, 20);pstManNodeFind = FindMan(pstManNodeHead, acId);if (pstManNodeFind == NULL){printf("can;t find!\n");}else//退票{printf("this is your tickets:\n");printf("id number:%s\n", pstManNodeFind->stDate.acID);printf("nmae:%s\n", pstManNodeFind->stDate.acName);printf("sex:%s\n", pstManNodeFind->stDate.acSex);printf("book flight:%s\n", pstManNodeFind->stDate.acBookFilght);printf("book number:%d\n", pstManNodeFind->stDate.iBookNum);printf("do you want to cancel it ?(y/n)");scanf_s("%s", acDecision, 2);getchar();if (strcmp(acDecision, "y") == 0){//找到前驱for (pstManNodeCur = pstManNodeHead; pstManNodeCur->pstNext != pstManNodeFind;pstManNodeCur = pstManNodeCur->pstNext);//找到该名订购人的航班记录pstPlaneNodeFind = FindPlane(pstPlaneNodeHead, pstManNodeFind->stDate.acBookFilght);//退票if (pstPlaneNodeFind != NULL){iNum = pstPlaneNodeFind->stDate.iNum;//机票剩余票数iBookNum = pstManNodeFind->stDate.iBookNum;  //订购人订购票数pstPlaneNodeFind->stDate.iNum = iNum + iBookNum;}//删除订票人节点pstManNodeCur->pstNext = pstManNodeFind->pstNext;printf("successful!\n"); //成功退订 iSave = 1;free(pstManNodeFind);}}}

保存信息

//保存机票信息
void SavePlane(struct PlaneNode* pstPlaneNodeHead)
{FILE* pfPlane;  // 机票的文件指针struct PlaneNode* pstPlaneNodeCur;int count = 0; //保存信息个数int iFlag = 1;int error = 0;//pfPlane = fopen("plane.txt", "wb");error = fopen_s(&pfPlane, "plane.txt", "wb");if (error != 0){printf("the file can't be opened!\n");return;}//写入信息pstPlaneNodeCur = pstPlaneNodeHead->pstNext;while (pstPlaneNodeCur != NULL){if (fwrite(pstPlaneNodeCur, sizeof(struct PlaneNode), 1, pfPlane) == 1){pstPlaneNodeCur = pstPlaneNodeCur->pstNext;count++;}else{iFlag = 0;break;}}//提示保存信息数目  ISave置为0if (iFlag){printf("you have save %d flights\n", &count);iSave = 0;}//关闭文件fclose(pfPlane);
}
//保存订票人信息
void SaveMan(struct ManNode* pstManNodeHead)
{assert(pstManNodeHead != NULL);if (pstManNodeHead == NULL){return;}FILE* pfMan;struct ManNode* pstManNodeCur;int count = 0;int iFlag = 1;int error = 0;//pfMan = fopen("man.txt", "wb");error = fopen_s(&pfMan, "man.txt", "wb");if (error != 0){printf("the file can't be opened!\n");}//写入信息pstManNodeCur = pstManNodeHead->pstNext;while (pstManNodeCur != NULL){if (fwrite(pstManNodeCur, sizeof(struct ManNode), 1, pfMan) == 1){pstManNodeCur = pstManNodeCur->pstNext;count++;}else{iFlag = 0;break;}if (iFlag){printf("you have save %d man", count);iSave = 0;}fclose(pfMan);}
}

显示时间

//显示当前时间
void NowTime()
{time_t curtime;curtime = time(NULL);printf("现在的时间是:%s", ctime(&curtime));
}

测试

先进行添加机票功能的测试
将添加机票信息输入完整,然后输入-1返回主菜单
然后对查询机票功能进行测试,输入刚刚添加的航班号,可以看出已经查询到新添加的机票信息
然后对修改机票信息功能进行测试,我们将目的地修改为beijing

然后返回主菜单,测试显示所有机票信息的功能

可以看出已经成功把1005号航班的目的地修改为beijing
对推荐机票功能进行测试
选择你要去的地方和你最早可以到达时间,然后会打印符合条件的机票信息

然后对订票功能进行测试

然后对退票功能进行测试,通过ID可以定位到刚刚订票的信息,然后选择退票

C语言实现飞机订票系统相关推荐

  1. C语言的飞机订票系统

    C语言的飞机订票系统,适合初学者.其中包含文件的输入输出操作,代码便于阅读.与我的另一篇银行的管理有相同的思想. #include<stdio.h> #include<string. ...

  2. 航班系统C语言程序流程图,飞机订票系统(C语言代码及流程图)

    飞机订票系统(C语言代码及流程图) 目录 第一部分 源程序---------------------------------------------------3 第二部分 函数流程图-------- ...

  3. c语言程序设计飞机,C语言程序设计――飞机订票系统

    <C语言程序设计――飞机订票系统>由会员分享,可在线阅读,更多相关<C语言程序设计――飞机订票系统(7页珍藏版)>请在人人文库网上搜索. 1.C语言程序设计飞机订票系统代码如下 ...

  4. c语言飞机买票系统,C语言实现飞机订票系统

    问题描述与题目要求 问题描述: 假定某民航有M个航次的班机,每个航次都只到达一个地方.试为该机场售票处设计一个自动订票和退票系统,要求系统具有以下功能: (1) 订票:若该航次余票大于等于乘客订票数, ...

  5. c语言机票座位预定系统_C语言实现飞机订票系统

    问题描述与题目要求 问题描述: 假定某民航有M个航次的班机,每个航次都只到达一个地方.试为该机场售票处设计一个自动订票和退票系统,要求系统具有以下功能: (1) 订票:若该航次余票大于等于乘客订票数, ...

  6. c语言编程存航线,C语言编程飞机订票系统如何设计?

    题目:编制一个航空客运订票系统,实现简单的机票操作 班级:计0702 姓名:学号: 完成日期:2008年12月20日 一. 实验内容: 1.问题描述: 航空客运订票的业务包括:查询航班.客票预订和办理 ...

  7. 如何用c语言制作飞机订票系统,C语言编程飞机订票系统如何设计?

    题目:编制一个航空客运订票系统,实现简单的机票操作 班级:计0702 姓名:学号: 完成日期:2008年12月20日 一. 实验内容: 1.问题描述: 航空客运订票的业务包括:查询航班.客票预订和办理 ...

  8. 飞机订票系统c语言常见错误,编写C语言:飞机订票系统

    满意答案 wukong828 2013.06.16 采纳率:46%    等级:12 已帮助:10888人 #include #include #include //#include #define ...

  9. c语言飞机订票信息查询,C语言飞机订票系统

    <C语言飞机订票系统>由会员分享,可在线阅读,更多相关<C语言飞机订票系统(11页珍藏版)>请在人人文库网上搜索. 1.课程设计课程:数据结构专业班级:XX软件工程XX班姓名: ...

  10. 飞机订票系统c语言大作业,C语言知识学习飞机订票系统

    C语言知识学习飞机订票系统 课程设计 课程:数据结构 专业班级:xx软件工程 xx班 姓名:xx 学号:xxx 姓名:xxx 学号:xxx 设计时间:xxx 指导老师:xxx 课程设计题:飞机订票系统 ...

最新文章

  1. pwm调制 matlab仿真,PWM脉冲调制直流电机的simulink仿真
  2. 【Android Gradle 插件】ProductFlavor 配置 ( ProductFlavor#buildConfigField 方法 | 单独编译生成 BuildConfig 类的任务 )
  3. 3.3 神经网络的输出-深度学习-Stanford吴恩达教授
  4. c语言作业小学生测试题,C语言实现小学生随机出题测试计分
  5. python 中的static-method (静态函数), classmethod(类函数 ), 成员函数
  6. JavaSE基础——数组概述和定义格式说明
  7. GPO备份还原复制及导入
  8. java 影院订票系统 影院售票系统 在线电影订票平台 jsp ssm
  9. Flutter绘制虚线
  10. 计算机英语单词怎么巧背,巧计英语单词的26个秘诀
  11. gulp打包报错 “Error: Unhandled ‘error‘ event at new JS_Parse_Error”
  12. 近几年美国人口数据matlab,2010-2019年美国人口数量及人口性别、年龄、城乡结构分析...
  13. 最近在搞TAM TIM
  14. Websocket和PHP Socket编程
  15. Oracle数据库----------------索引
  16. 开发一款app软件需要什么样的服务器
  17. 计算机没有usb视频教程,Win7已安装但没有USB3.0驱动如何安装教程
  18. 图像分类androidAPP
  19. word中三线表的制作(及续表的制作)
  20. 电脑重装系统后桌面没有计算机图标,电脑重装系统后桌面没有图标了怎么办

热门文章

  1. KNX转485模块的开发
  2. stata15软件win版安装meta模块命令分析模块百分百解决所有安装问题下载地址
  3. 云闪付app怎么删除常用转账人?云闪付转账记录怎么删除?
  4. 微信小程序订阅服务器,微信小程序之模板订阅消息
  5. 海思使用HiTool下载程序
  6. python网络爬虫项目——翻译英文单词
  7. java 菜刀_Java中国菜刀(Cknife)的模拟终端乱码解决方法 | 【韩涛博客】
  8. html+车牌号选择,html中车牌号省份简称输入键盘的示例代码
  9. LeetCode答案详解
  10. 云计算机房的建设预算,射阳高级中学云计算机房建设预算.doc