c语言程序设计综合实习报告车票管理系统内容摘要:

,records[i].now)。 else printf(|%10s| 已发车 |%10s|%10s|%|%8d|%8d|,records[i].num, records[i].from,records[i].to,records[i].hours,records[i].max,records[i].now)。 } ShowTable2(j)。 //线框调用 2 printf(\n按任意键继续 ....\n)。 getch()。 /////从控制台读取一个字符,但不显示在屏幕上 } /********************************** 打 印 表 头***********************************************/ void ShowTable1() //线框调用 1,,不用没次输 { int i=2。 system(cls)。 //刷屏 printf(**************************MESSAGE 车 程 信 息**********************************\n)。 printf(\n||||||||\n)。 printf(\n| 班次 | 发车时间 | 起点站 | 终点站 |行车时间 |额定载量 | 已售票 |\n)。 } /*************************************** 打 印 表 尾************************************************/ void ShowTable2(int i) //线框调用 2。 不用没次输。 { printf(\n||||||||\n)。 } /**************************查找函数 11**************************/ void search() ////查询调用 { int i。 char s1[10]={39。 \039。 },s2[10]={39。 \039。 }。 system(cls)。 //刷屏 printf(1. 按班次查询 \n)。 printf(2. 按终点站查询 \n)。 printf(3. 退出 \n)。 printf(请选择 (13):\n)。 scanf(%d,amp。 i)。 load()。 // 调用按班次查询函数 11 switch(i) //多分枝选择语句 { case 1: printf(请输入要查询的班次 :\n)。 //////s1为班次 scanf(%s,s1)。 find(s1,s2)。 /////调用查找函数 222 2 break。 case 2: printf(请输入要查询终点站 :\n)。 /////s2为终点站 scanf(%s,s2)。 find(s1,s2)。 /////调用查找函数 222 2 break。 case 3: break。 default : printf(输入错误 !\n)。 break。 } printf(按任意键继续 ....\n)。 getch()。 ///从控制台读取一个字符,但不显示在屏幕上 } /********************************查询函数 22*********************************/ void find(char s1[],char s2[]) { int i,h=0,m。 ShowTable1()。 ////调用线框 1 if(s2[0]==39。 \039。 ) m=1。 ///1为无条件执行 else m=0。 for(i=0。 iclass_num。 i++) if(strcmp(s1,records[i].num)==0||strcmp(s2,records[i].to)==0) ////判断字符串比较是否相等, 待比较的字符串 { printf(\n||||||||\n)。 printf(|%10s|%5s:%4s|%10s|%10s|%|%8d|%8d|,records[i].num,records[i].hour,records[i].min, records[i].from,records[i].to,records[i].hours,records[i].max,records[i].now)。 h+=2。 if(m==1) break。 } ShowTable2(h)。 ////调用线框 2 if(h==0) printf(要查找的班次不存在 !\n)。 } /***********************增加函数 ****************************/ 12 void add() // //增加记录 { int i,j=5。 load()。 // 调用按班次查询函数 system(cls)。 //刷屏 printf(1. 增加班次 \n)。 printf(2. 返回 \n)。 printf(请选择 (12)\n)。 scanf(%d,amp。 i)。 if(i==1) { system(cls)。 //刷屏 printf(1. 请输入要增加的班次 :\n)。 scanf(%s,records[class_num].num)。 for(i=0。 iclass_num。 i++) if(strcmp(records[class_num].num,records[i].num)==0) //判断字符串比较是否相等, 待比较的字符串 判断车次没重复 { printf(输入错误 !\n)。 getch()。 /////从控制台读取一个字符,但不显示在屏幕上 break。 } if(i==class_num) { get(i,j)。 ////修改及增加班次 * class_num++。 ///使班次数加 1 save()。 //调用保存函数 } } } /********************************售票函数 *****************************/ void Ticketorder() //*售票函数 *** { int i。 char num[10]。 system(cls)。 //刷屏 printf(1. 售票 \n)。 printf(2. 返回 \n)。 printf(请选择 (12):\n)。 scanf(%d,amp。 i)。 if(i==1) { load()。 // 调用按班次查询函数 search(。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。