首页 软件工程与计算课程设计_停车管理系统-软件124-何航-1208060365.doc

软件工程与计算课程设计_停车管理系统-软件124-何航-1208060365.doc

举报
开通vip

软件工程与计算课程设计_停车管理系统-软件124-何航-1208060365.doc软件工程与计算课程设计_停车管理系统-软件124-何航-1208060365.doc 课程名称: 软件工程与计算 实验项目: 停车场收费管理系统 姓 名: 何航 专 业: 计算机科学与技术 班 级: 124班(12级) 学 号: 1208060365 指导教师 申玲 2014年11月9日 department heads meeting agreed matters assigned by the leadership group, the book down and do the importa...

软件工程与计算课程设计_停车管理系统-软件124-何航-1208060365.doc
软件工程与计算课程设计_停车管理系统-软件124-何航-1208060365.doc 课程名称: 软件工程与计算 实验项目: 停车场收费管理系统 姓 名: 何航 专 业: 计算机科学与技术 班 级: 124班(12级) 学 号: 1208060365 指导教师 申玲 2014年11月9日 department heads meeting agreed matters assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(two) grasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and difficult problem of youth reflects the implementation of regular and dynamic 摘要 目前,我国经济逐渐发达,自行车王国逐步向汽车进军。因此,大量的停车场也随之而至。虽然某些大型停车场在工作中已经开始向计算机化靠拢,但仍不够完善。而中小型停车场更为稀少,陈旧的管理手段给顾客带来极大的不便,同时为了提高工作效率及服务质量,一套完整的停车厂管理系统的出现就十分必要了。 本次设计,仅为一个简单的小型停车场管理系统。采用C语言编写,为dos界面。主要强调车辆的进站和出站操作,以及车场和通道之间的相互关系。根据车场内车道狭长且为一边开口的特点,将车道用先进后出的栈结构来描述。外面狭长的通道,为先进先出,可采用队列结构,为方便起见,采用链式队列结构来描述。本程序中的数据对象是汽车,为使操作更方便,将给每辆进车道的汽车编号,根据编号出场。其中,还包括入场时间、出厂时间、收取费用等项。 关键字:停车场管理系统 栈结构 队列结构 软件工程 difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters II 目录 1需求分析 ....................................................................................................................... 0 1.1 引言............................................................................................................ 0 1.1.1 设计目的.............................................................................................. 0 1.1.2 任务概述.............................................................................................. 0 1.2 基本要求..................................................................................................... 0 1.3 系统用户分析.................................................................................................... 1 1.4 用数据流程图描述 ........................................................................................... 1 2概要设计 ....................................................................................................................... 3 2.1 设计思想..................................................................................................... 3 2.2 实现方法 .......................................................................................................... 3 2.3 主要模块 .......................................................................................................... 3 2.4 各模块的主要功能及实现 ............................................................................ 4 2.2.1 车辆到达模块....................................................................................... 4 2.2.2 车辆离开模块....................................................................................... 4 2.2.3 停车场内与通道停放车辆的信息模块.................................................... 4 2.2.4 获取时间.............................................................................................. 5 2.5 MATCH_ word word文档格式规范word作业纸小票打印word模板word简历模板免费word简历 _1714130870684_2间调用关系 ................................................................................................ 5 3详细设计 ....................................................................................................................... 7 3.1 界面及各模块详细设计................................................................................ 7 4系统测试 ....................................................................................................................... 9 4.1 功能测试..................................................................................................... 9 4.1.1 车进站时车牌号的测试 .......................................................................... 9 5总结 .............................................................................................................................11 5.1 用户手册....................................................................................................11 5.2 设计体会....................................................................................................11 参考文献........................................................................................................................ 12 附 .................................................................................................................................. 13 fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters asIII 1需求分析 1.1 引言 1.1.1 设计目的 a.通过课程设计,加深对软件工程思想的理解,能对系统功能进行分析,并设计合理的模块化结构。 b. 通过课程设计,提高程序开发功能,能运用合理的控制流程编写清晰高效的 程序。 通过课程设计,训练C程序调试能力,能将一个中小型各级组织系统联调通过。 c. 通过课程设计,开发一个中小型系统,掌握运用软件工程思想研来发系统全 过程。 d. 通话课程设计,培养分析问 快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题 、解决实际问题的能力。 1.1.2 任务概述 设有一个可以停放20辆汽车的狭长停车场,它只有一个大门可以供车辆进出。车辆按到达停车场时间的早晚依次从停车场最里面向大门口处停放(最先到达的第一辆车放在停车场的最里面)。如果停车场已放满20辆车,则后来的车辆只能在停车场大门外的通道上等待,一旦停车场内有车开走,则排以便道上的第一辆车就进入停车场。停车场内如有某辆车要开走,在它之后进入停车场的车都必须先退出停车场为它让路,待其开出停车场后,这些辆再依原来的次序进场。每辆车在离开停车场时,都应根据它在停车场内停留的时间长短交费。如果停留在便道上的车未进停车场时,允许其离去,不收停车费,并且仍然保持在通道上等待的车辆的次序。编制一程序模拟该停车场的管理 。 要求程序输出每辆车到达后的停车位置(停车场或便道上),以及某辆车离开停车场应交纳的费用和它在停车场内停留的时间。 1.2 基本要求 要求程序输出每辆车到达后的停车位置(停车场),以及某辆车离开停车场应交纳的费用和它在停车场内停留的时间。 difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 0 1.3 系统用户分析 “停车场管理系统”主要是针对车辆存取工作而开发的应用软件。通常有系统管理员、停车场车辆管理员和顾客三种用户,他们的使用权限如下: 系统管理员:计算机人员,对系统进行维护。 图书管理员:对停车信息进行数据操作。 顾客:仅限于查阅。 1.4 用数据流程图描述 图1-1是根据操作流程建立的流程图。 表1-1是车能否进停车场的判定表。 图1 -1 停车场流程图 车场内车数 <20 <20 >20 >20 fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as1 车牌号位数 <2或>5 >2且<5 <2或>5 >2且<5 进站 ? 进通道 ? 表1-1 进站停车判定表 difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 2 2概要设计 2.1 设计思想 此停车场管理系统是在一个狭长的通道上的,而且只有一个大门可以供车辆进出,并且要实现停车场内某辆车要离开时,在它之后进入停车场的车都必须先退出停车场为它让路,待其开出停车场后,这些辆再依原来的次序进场的功能,就可以设计两个堆栈,其中一个堆栈用来模拟停车场,另一个堆栈用来模拟临时停车场,该临时停车场用来存放当有车辆离开时,原来停车场内为其让路的车辆。至于当停车场已满时,需要停放车辆的通道可以用一个链队列来实现。当停车场内开走一辆车时,通道上便有一辆车进入停车场,此时只需要改变通道上车辆结点的连接方式就可以了,使通道上第一辆车进入停车场这个堆栈,并且使通道上原来的第二辆车成为通道上的第一辆车,此时只需将模拟通道的链队列的头结点连到原来的第二辆车上就可以了。 2.2 实现方法 对于此停车场管理系统的实现,就是用两个堆栈来分别模拟停车场以及 停车场内车辆为其它车辆让路时退出停车的临时停放地点。至于通道上车辆 的停放则用一个链队列来实现,此时,通道上车辆的离开或者进入停车场只 需改变此链队列上的结点而已。对于要对停车场内的车辆根据其停放时间收 取相应的停车费用,可以 记录 混凝土 养护记录下载土方回填监理旁站记录免费下载集备记录下载集备记录下载集备记录下载 下车辆进入以及离开停车场的时间,再用时间 差乘以相应的单价并且打印出最后的费用就可以实现了。 2.3 主要模块 ?此停车场管理系统,主要分为以下若干模块: 首先定义用来模拟停车场的堆栈以及用来模拟通道的链队列为全局变 量,然后编写主函数,在此主函数中实现对其它各个模块的调用。在主函数 中首先打印出此停车场管理系统选择页面,在用户的选择过程中,程序又分 别调用车辆的到达、车辆的离开、停车场内与通道停放车辆的信息以及获取 时间这四个函数模块。其中,在车辆的离开那个模块函数中又调用了打印离 fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as3 开车辆信息的函数,在停车场内停放车辆信息的那个模块函数中,又分别调 用了显示停车场上车辆信息的函数以及显示便道上车辆信息的函数。最后, 从调用的这四个函数中回到主函数结束整个程序的运行。 2.4 各模块的主要功能及实现 2.2.1 车辆到达模块 此模块主要实现车辆进入停车场功能,通过判断合法性决定车辆能否进入停车场。 实现伪码: If 车场内车数<20辆 and 车牌号码合法 then 车辆进入停车场并编号及记录时间 End if If 车场已满 then 进入通道 End if 车牌号码合法性判断伪码: If 车牌号位数>2 and <5 and 无重复车牌 then 车牌号码合法 nd if E 2.2.2 车辆离开模块 此模块主要实现车辆离开停车场功能,并能打印出车辆停留时间及费用。 实现伪码: If 车场不为空 and 序号存在 then 车辆出停车场并打印出进出时间及费用 End if 2.2.3 停车场内与通道停放车辆的信息模块 此模块主要实现车场车辆的停放及通道的利用,是本设计的核心。就是用两个堆栈来分别模拟停车场以及停车场内车辆为其它车辆让路时退出停车的临时停放地点。至于通道上车辆的停放则用一个链队列来实现,此时,通道上车辆的离开或者进入停车场只需改变此链队列上的结点。 difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 4 模块中出现的函数: void init (SeqStack *s); int isemptystack (SeqStack *s); int isfullstack (SeqStack *s); int isfullstack (SeqStack *s); void push (SeqStack *s); struct car pop (SeqStack *s,struct car x); car gettop (SeqStack *s); void initq(linkq*q); void addq(linkq*q,struct car x); struct car delq(linkq *q); int isemptyq(linkq *q); void printout(struct car *x); void printq(linkq *q); void review(SeqStack*s,linkq*q); 2.2.4 获取时间 该模块主要获取车辆时间信息,用以计算车辆停车费用。 2.5 函数间调用关系 如下图2-1所示 fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as5 主函数 用户界面 review incar outcar clear printstack printq gettime printout incar outcar 主函数 结束 图2-1 函数调用关系图 图中函数解释: review 查看车站内及通道内停车情况函数。 incar 车进站函数。 outcar 车出站函数。 clear 定义数组函数。 printstack 车进站时输入信息显示,及提示站内情况函数。 printq 进过道信息函数。 gettime 获取时间函数。 printout 出站时的信息函数。 difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 6 3详细设计 3.1 界面及各模块详细设计 进入界面后如下图所示。 图3- 1 首界面 测试要点:各选项与相应的功能能否成功连接。 1.车进站 (1).功能:添加车牌号排序后进站。 (2).输入项:车牌号。 (3).输出项:车在车站内的“位置”“车牌”“进站时间”“站内状况”。 (4).测试要点:注意不合法的车牌号能否在系统通过。 2.车出站 (1).功能:实现收费后出车站。 (2).输入项:车序号。 (3).输出项:车的“车牌”“进站时间”“进/出站”状态“出站时间”“原来位 fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as7 置”“停留时间”“费用”。 (4).测试要点:要出站的车序号是否存在。 3.查看车站及过道中的情况 (1).功能:查看车站及过道中车辆情况。 (2).输入项:查看提示。 (3).输出项:车场内状态即停车数量,以及通道内停车数量。 (4).测试要点:能否正确显示车的数量。 4.获取帮助 (1).功能:放回到开始界面。 (2).测试要点:能否正确返回。 5.结束 (1).功能:结束程序。 difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 8 4系统测试 4.1 功能测试 4.1.1 车进站时车牌号的测试 1.划分等价类及测试用例如下表所示。 假设此时站内有一辆编号为ABC的车。 表4-1 车牌号等价类划分表 输入条件 合理等价类 不合理等价类 长度 (1)小于5个字符,大于2个字符 (3)小于2个字符 (4)大于5个字符 字符 (2)与站内车牌不重复 (5)与站内车牌相同 表4-2 车牌号测试用例 测试结果 期望结果 覆盖范围 ddd 有效 (1)(2) A 无效 (3) 123456 无效 (4) ABC 无效 (5) 2.车出站时的序号测试 1.划分等价类及测试用例如下表所示。 假设此时站内有一辆编号为ABC的车,车的序号为1。 表4-3 车序号的合理等价类 输入条件 合理等价类 不合理等价类 存在性 (1)存在 (2)不存在 fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as9 表4-4 车序号的测试用例 测试结果 期望结果 覆盖范围 1 有效 (1) 3 无效 (2) difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 10 5总结 5.1 用户手册 这个程序用来实现对停车场内车辆的管理,整个操作界面为中英文结合,更加符合人性化的 标准 excel标准偏差excel标准偏差函数exl标准差函数国标检验抽样标准表免费下载红头文件格式标准下载 ,使得用户使用方便,而且每一个操作都有提示,使得初次接触该程序的用户也能很快适应程序的操作。 这个程序操作简单,对于进出停车场的时间,也简化了操作,系统会自动获取提交时的时间,即进站和出站的时间。而且该程序也给用户提供了选择的机会,当点击运行该程序后,如果想退出程序,可以输入END退出该运行程序。 至于使用过程中的更具体的问题,可以参照该报告书中详细设计,整个程序的运行界面大致就如详细设计中屏幕截图的内容。 5.2 设计体会 通过这一周的课程设计,加深了我对《数据结构》这门课程所学内容的进一步的理解与掌握;同时,通过对停车场管理系统的开发,使得我将计算机课程所学知识与实际问题很好地相联接在了一起。在这次课程设计中,不仅培养了我开发一个中小型程序的能力,而且也培养了我的团队合作能力。在这次对停车场管理系统的开发过程中,我们小组成员互相合作,互相帮助,其中有程序功能成功实现时的欣喜,也有遇到问题、解决问题时的执着以及迷茫。在这次课程设计中,使得我很好地了解了在开发程序过程中合作的重要性。 在这周课程设计中,我们小组所开发的停车场管理系统,基本上可以完成每一项功能。汽车进入停车场的信息、离开停车场的信息以及通道上的信息都可以在程序上一一实现。但是,该程序也有不足的地方。主要表现在车辆的车牌号上,现实中的车牌号是一串字符,可是,在这个程序中并无限制,任何字符均可,这个与现实是有些不符的。在改进的程序中,还应该增加时间的判断功能,即停车场内有可能有车辆停放的时间超过一天。 还有一个很重要的问题,对于停车场外的通道在现实中是不可能无限长的, fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as11 而我们的设计中为了便于考虑就忽略了这一点。 总之,在这周的课程设计中,我以及我们这组的收获还是挺大的,不仅对于专业课有了更好的认识,而且在合作的过程中更加了解了团队精神的重要性。 参考文献 [1]秦峰.数据结构(C语言版)[M].合肥:中国科学技术大学出版社,2008 [2]R.C.T.Lee S.S.Tseng R.C.Chang.王卫东译.算法设计与分析导论[M].北京:机械工业出版社,2008 [3]Ira Pohl.陈朔鹰 马瑞 薛静锋 吕坤译.C++教程[M].北京:人民邮电出版社,2007 difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 12 附 源代码: #include"stdio.h" #include"string.h" #include"stdlib.h" #include"time.h" #define null 0 #define Maxsize 20//定义最大停车辆数 FILE * fp; void clear(char a[]) { int i,counta; counta=strlen(a); for(i=0;itop=-1; } fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as13 int isemptystack(SeqStack *s)//判断栈是否为空 { if(s->top==-1) return 1; else return 0; } int isfullstack(SeqStack *s)//判断栈是否为满 { if(s->top==Maxsize-1) return 1; else return 0; } void push(SeqStack *s,struct car x)//进栈 { if(!isfullstack(s)) { s->top++; s->d[s->top]=x; } } struct car pop(SeqStack *s)//取栈顶元素,出栈 { car x; if(s->top!=-1) { x=s->d[s->top]; s->top--; return x; } } car gettop(SeqStack*s)//取栈顶元素 { car x; if(s->top!=-1) { x=s->d[s->top]; return x; } difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 14 } typedef struct slnode//定义链队列的结点性质 { struct car data; struct slnode *next; }slnodetype; typedef struct //定义链的性质 { slnodetype *head; slnodetype *rear; }linkq; void initq(linkq*q)//初始化链队列 { q->head=(slnodetype*)malloc(sizeof(slnodetype)); q->rear=q->head; ->head->next=null; q q->rear->next=null; } void addq(linkq*q,struct car x)//进队列 { slnodetype *p; p=(slnodetype*)malloc(sizeof(slnodetype)); p->data=x; p->next=null; q->rear->next=p; q->rear=p; } struct car delq(linkq *q)//出链队列 { slnodetype *p; struct car x; if(q->head!=q->rear) { p=q->head->next; if(p->next==null) { x=p->data; q->rear=q->head; fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as15 free(p); } else { q->head->next=p->next; x=p->data; free(p); } return x; } } int isemptyq(linkq *q)//判断链队列是否为空 { if(q->rear==q->head) return 1; else return 0; } void printstack(SeqStack *s)//车进站时输入信息显示,及提示站内情况 { int i; if(isemptystack(s)) printf("车站内没有车。"); else { printf("\t\t车站内\n位置\t车牌\t进站时间\t 站内状况\n"); for(i=0;i<=s->top;i++) { printf("\n"); printf("%d\t",s->d[i].position); printf("%s\t",s->d[i].num); printf("%s\t",s->d[i].intime); } printf("共%d辆",s->top+1); if(s->top==Maxsize-1) printf("(已满)\n"); else printf("(还能放%d辆)\n",Maxsize-1-s->top); printf("\n"); difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 16 } } void printout(struct car *x)//出站时的信息 { printf("车牌 进站时间 进/出站 出站时间 原来位置 停留时间(秒) 费用(角)\n"); printf("%s ",x->num); printf("%s ",x->intime); printf("出 "); printf("%s\t",x->outtime); printf("%d\t",x->position); printf("%d\t",x->delay); printf("\t%d\n",x->expense); } void printq(linkq *q) //进过道信息 { if(!isemptyq(q)) { slnodetype*p; p=q->head->next; printf("\t过道:\n车牌:\t进道时间:\n"); printf("%s\t%s\n",p->data.num,p->data.intime); while(p->next!=null) { p=p->next; printf("%s\t%s\n",p->data.num,p->data.intime); } } else printf("\n过道上有没有车在等待\n"); } void review(SeqStack*s,linkq*q)//查看车站和过道上的情况 { printf("*******************************************************\n "); printstack(s); printq(q); fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as17 printf("*******************************************************\n "); } void gettime(char a[])//获取时间 { int i; static char nowtime[30]; time_t t; time(&t); strcpy(nowtime,ctime(&t)); for(i=0;i<9;i++) nowtime[i]=nowtime[i+11]; nowtime[i]='\0'; strcpy(a,nowtime); } void incar(SeqStack*s,linkq*q) //车进站(即输入IN后) { int i; int flg; struct car k; static char nowtime1[10]; printf("请你输入车牌(2-5位):\n"); gets(k.num); if(strlen(k.num)<2||strlen(k.num)>5) { printf("车牌号位数不对~"); } for(i=0;itop;i++) if(!(strcmp(k.num,s->d[i].num))) flg=1; while(1) { if(flg==1) { printf("车牌号已存在~\n"); gets(k.num); } else difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 18 break; } gettime(nowtime1); strcpy(k.intime,nowtime1); ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////// fprintf(fp,"车牌号 %s 时间: %s\n",k.num,k.intime); if (!isfullstack(s)&&isemptyq(q)) //若车站不满,而且过道上没有车,则直接进入车站 { k.position=(s->top)+2; push(s,k); printstack(s); } else if(isfullstack(s)||!isemptyq(q))//若过道上还有车,则必须放在过道上 { printf("*************************警告************************\n车站已满,请暂时放在过道。\n现在情况如下:\n"); k.position=Maxsize; addq(q,k);//放在过道上 printstack(s);//输入车站情况 printq(q);//同时输入当时过道上的情况 printf("*****************************************************\n") ; } } void outcar(SeqStack *s,linkq *q) //车出站 { SeqStack p; //申请临时放车的地方 init(&p); char nowtime[10]; int i,pos; long cost; int hour,min,sec; fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as19 struct car x,b,y1,y2,z; if(isemptystack(s)) { printf("车站是空的,不能再出站了~\n"); printf("\a"); } else { printf("现在车站的情况是:\n"); printstack(s); printf("你要出站的车的序号是:\n"); scanf("%d",&pos); if(pos>0&&pos<=s->top+1) { for(i=s->top+1;i>pos;i--) { x=pop(s); x.position=x.position-1; push(&p,x); } b=pop(s); gettime(nowtime); strcpy(b.outtime,nowtime); hour=(b.outtime[0]-'0')*10+(b.outtime[1]-'0')-((b.intime[0]-'0')* 10+(b.intime[1]-'0')); min=(b.outtime[3]-'0')*10+(b.outtime[4]-'0')-((b.intime[3]-'0')*1 0+(b.intime[4]-'0')); sec=(b.outtime[6]-'0')*10+(b.outtime[7]-'0')-((b.intime[6]-'0')*1 0+(b.intime[7]-'0')); b.delay=hour*3600+min*60+sec; cost=b.delay; b.expense=cost; printout(&b);//输出车出站时的情况---进入时间,出站时间,原来位置,花的费用等 while(!isemptystack(&p)) //车出来后把刚才退出的车重新放回 { z=pop(&p); push(s,z); } difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 20 if(!isfullstack(s)&&!isemptyq(q)) { y1=delq(q); strcpy(y1.intime,nowtime); push(s,y1); } while(!isfullstack(s)&&!isemptyq(q)) { y2=delq(q); push(s,y2); } } else { printf("有没有你要的车号\n"); printf("\a"); } } } int main() { SeqStack park; linkq q; init(&park); initq(&q); char mess[10]; ///////////////////////////////////////////////////////////////// ///////////////////////////////////// fp=fopen("car_list.text","w"); printf("\t\t\t~~~ 车场管理系统 ~~~ \n\t\t\t\n*********************************************************** ***************\n\n"); printf("提示:车站内最多只能放Maxsize(由系统中定义)辆车,多余的暂时放在过道上。\n车站内收费标准:1角/秒,过道上不收费。\n"); printf("\n你想进行什么操作,\nIN---> 车进站\nOUT--->车出站\nLIST--->查看车站及过道中的情况\nHELP--->获取帮助\nEND--->退出系统\n"); printf("\n操作:"); gets(mess); while(1) fficult problem of youth reflects the implementation of regular and dynamicsp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and dio) graion, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(twsigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervisdepartment heads meeting agreed matters as21 { if(strcmp(mess,"END")==0) { printf("\t\t\t欢迎下次再来,再见~\n"); break; } else if(strcmp(mess,"HELP")==0) { printf("\n你想进行什么操作,\nIN--->车进站\nOUT--->车出站 \nLIST--->查看车站及过道中的情况\nHELP--->获取帮助\nEND--->退出系统 \n\n"); printf("操作:"); clear(mess); gets(mess); } else { if(strcmp(mess,"LIST")==0) { review(&park,&q); printf("操作:"); } else if(strcmp(mess,"IN")==0) { incar(&park,&q); printf("操作:"); } else if(strcmp(mess,"OUT")==0) { outcar(&park,&q); } else printf("操作:"); clear(mess); gets(mess); } } } //问题:车牌号位数且车牌号可以重复 difficult problem of youth reflects the implementation of regular and dynamicrasp the key special supervision. According to different periods of work needs, focus on leadership, social concern, hot and two) gision, to ensure that the inspection item piece is an echo, everything in the bag, to promote the work carried out smoothly.(assigned by the leadership group, the book down and do the important matters and the regiment the key work to focus on supervdepartment heads meeting agreed matters 22
本文档为【软件工程与计算课程设计_停车管理系统-软件124-何航-1208060365&#46;doc】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_882336
暂无简介~
格式:doc
大小:114KB
软件:Word
页数:38
分类:交通与物流
上传时间:2018-04-03
浏览量:16