c课程设计——航空售票管理系统(编辑修改稿)内容摘要:
if (!newfile) { cerr 文件 \flight \无法打开。 \n。 exit(2)。 } ()。 int tab。 while(1) { cout \n 欢迎进入航空售票管理系统 ****** 主 菜 单 : *********** ****** 1—— 更新航班信息(需管理员身份验证) 2—— 浏览航班信息 *********** ****** 3—— 查询航班信息 4—— 订票 和 退票 *********** ****** 5—— 清 屏 0—— 退 内蒙古科技大学 课程 设计 说明书 14 出 系 统 *********** ******************************************************************************** 你需要做什么。 (选择 0~4) endl。 cin tab。 while(!(tab == 1 || tab == 2 || tab == 3 || tab == 4 || tab == 5 || tab == 0)) { cout 请输入正确选择( 0~4):。 cin tab。 } switch(tab) { case 1: { ()。 break。 } //航线管理 case 2: { ()。 break。 } //订票办理 case 3: { ()。 break。 } //退票办理 case 4: { ()。 break。 } case 5: system(cls)。 break。 case 0:return 0。 //退出系统 内蒙古科技大学 课程 设计 说明书 15 } } } 文件 —— class/ include vector using namespace std。 include //用于对文件的操作 class Traffic_system { public: Traffic_system() { m_sum = 0。 } void Manage()。 //管理航班信息 void Scan()。 //浏览 int Search(int invoke = 0)。 //查询功能 void BookRefund()。 //订票和退票 private: void Read_file()。 //读取文件 void Save_file()。 //保存文件 private: int m_sum。 //记录航班数 vector Flight v_array。 //航班类数组 }。 文件 —— class/ include fstream 内蒙古科技大学 课程 设计 说明书 16 include iostream using namespace std。 include //读取文件 void Traffic_system::Read_file() { ifstream file( flight )。 if (!file) { cerr 文件 \flight \无法打开。 \n。 exit(1)。 } m_sum = 0。 while (!()) { Flight fly。 (fly)。 // file v_array[m_sum++]。 } m_sum。 // ()。 } //保存文件 void Traffic_system::Save_file() { ofstream file( flight , ios::trunc)。 if (!file) { cerr 文件 \flight \无法打开。 \n。 exit(2)。 } 内蒙古科技大学 课程 设计 说明书 17 int i = 1。 while (++i m_sum) { if (!v_array[i].If_deleted()) { file v_array[i]。 } } ()。 } //管理航班信息 void Traffic_system::Manage() { char password[20]。 //用于存贮密码 int times = 3。 cout 登录系统需验证密码。 endl。 //验证密码。 三次错误后,就自动退出程序 do { times。 cout 请输入密码 :(默认 000)。 cin password。 if(strcmp(password, 000) == 0)//密码是“ 000” { times = 1。 break。 } else if (times 0) cout 密码错误 !\n 剩余 times 次机会 ! endl。 }while(times 0)。 if(times != 1) { cout 对不起 !\n 您不是管理员 ! 不能使用此系统 ! endl。 return。 内蒙古科技大学 课程 设计 说明书 18 } system(cls)。 while (1) { int tab。 cout \n******************************欢迎使用航班信息管理系统**************************\n ———————————————————————————————————————— \t**\t 1 —— 重 新 创 建 信 息 库 \t\t 2 —— 插入信息 **\n\t**\t 3—— 修改信息 \t\t 4—— 删除信息 **\n\t**\t 5—— 删除全部\t\t 0—— 退出管理 **\n ———————————————————————————————————————— 你需要做什么。 (选择 0~5) endl。 cin tab。 while(!(tab == 1 || tab == 2 || tab == 3 || tab == 4 || tab == 5 || tab == 0)) { cout 请输入正确选择( 0~5):。 cin tab。 } switch(tab) { case 1: { m_sum = 0。 Flight fly。 cout 请进行信息录入。 按“ +”结束。 \n。 do (fly)。 // while (v_array[m_sum++].SetInfo())。 break。 } 内蒙古科技大学 课程 设计 说明书 19 case 2: { Read_file()。 Flight fly。 cout 请进行信息录入。 按“ +”结束。 \n。 do (fly)。 // while (v_array[m_sum++].SetInfo())。 break。 } case 3: { char fnum[1][18]。 Read_file()。 cout 请输入您要修改信息的航班号:。 cin fnum[0]。 int i = 0。 for (。 i m_sum。 i++) { if (v_array[i].If_match(fnum, 39。 139。 )) { cout 该航班的原信息为: \n ——————————————————————————————————————— \n 丨 航 班 号 丨 起 始 站 丨 终 点 站 丨起飞时间丨票价丨余 票丨 ——————————————————————————————————————— \n。 v_array[i].Display()。c课程设计——航空售票管理系统(编辑修改稿)
相关推荐
void Inver(CMatrix amp。 mat)。 //******************************矩阵转置 VectorT amp。 operator []( int i)。 //***********************重载 [] operator T **()。 //****************************************重载 **
ide from structure, PLC is divided into a regular type and sectional (module type ) two kinds Regular type PLC including CPU board , I/O board , showing the panel , memory lump , power ,etc., these
value for the square pipe without ball packing, and isnot affected by the ball diameter. However, in the caseof dH1135012 mm, amaxis larger than that for dH1134910 mm. Asa result, the dynamic
//读取飞机起飞时间 scanf(%s,a[i].time)。 printf(请输入座位数量 :)。 //读取座位数 量 scanf(%d,amp。 a[i].num)。 a[i].lastseatnum=a[i].num。 printf(\n)。 js++。 printf(是否要继续: Y 或 N\n)。 scanf(%c,amp。 u)。 scanf(%c,amp。 u)。 if(u!=39
books_list *head) { /*定义结构体 指针变量 s 指向开辟的新结点首地址 p 为中间变量 */ struct books_list *s, *p。 char flag=39。 Y39。 /*定义 flag,方便用户选择重复输入 */ p=head。 /*遍历到尾结点, p 指向尾结点 */ while(pnext!= NULL) { p=pnext。 } /*开辟新空间
不同的 评语; 按 esc 键退出,其他任意键清除屏幕 信息并继续 . 计算机学院通信 11 级 C 程序设计报告 3 、算法设计 本程序实现的功能要求:利用 if语句完成所示的主菜单。 、部分模块流程 图 见下页 用 dos 命令,实现程序暂停 用户选择退出或重新开始 计算总分与用户得分 根据提示选择是否开始 进行答题 ,错误提示正确答案 根据提示计算的题目数 计算机学院通信 11 级 C