ImageVerifierCode 换一换
格式:DOCX , 页数:21 ,大小:330.18KB ,
资源ID:13673705      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-13673705.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(停车场模拟管理系统报告附源代码.docx)为本站会员(b****6)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

停车场模拟管理系统报告附源代码.docx

1、停车场模拟管理系统报告附源代码 实训报告专 业:班 级:学 号:姓 名:课设题目: 停车场模拟管理系统 指导教师:1、需求分析 停车场模拟管理系统现在很多的大型超市等都有智能的停车场当你进入停车场门口就会自动的显示里面还有多少的空位并且指引你走到空的车位停下避免了把车辆开进去并且找不到空的车位和因为车子在停车场内乱走而导致想出来的车没有足够的时间出来。导致空间和时间各种不必要的麻烦所以急需我们做一个停车场管理系统 。我们的停车场模拟管理系统有以下方面功能:1记录进入停车场的车辆的车牌号从而进入后可以知道其所停的停车位。2车子离开停车场根据离开时间和进入时间从而计算出所需要交的费用。3如果队列已

2、经满了可以让要进入停车场的车子停在旁边的等候队列。2、总体设计2.1系统功能概述(1)如果选择进入停车场就要判断停车场是否已经满了,如果未满直接进入,如果满了的话就直接排在旁边的便道上等待有车子离开停车场从而进入停车场。(2)同时改程序还设立多了一个位置以便与有车进入同时有车离开可以停留在这里等候车子离开再进入。(以防止车子停车场内的车未能离开进入的车又正在进入从而导致停车场堵塞的情况)(3)离开的时候根据离开的车牌号从而把它从停车场中的位置移开并且通过离开时间和进入停车场的时间来计算出该车子所需要交纳的费用。 有车离开 如果等候队列不为空的话进入停 2.11 总体设计图3、到达停车场准备进入

3、停车场void parkingmanagement:arrival(carstack &cs,carqueue &cq,int cnum,double ctime) int pos;if(!(cs.full() 到达停车场的车子首先输入其判 int fl(0),i; 断停车场是否已经满了如果则直 for(i=0;i=cs.top;i+) 接进入等候车道否则就进入停场 if(cs.si.number=cnum) fl=1; break; if(fl=1) cout输入错误!请重新输入!如果到达的车的车牌号!=栈内已有车辆的车牌号endl; else pos=pushstack(cs,cnum,c

4、time);/入栈,返回车位信息 cout该停车场还有空位,请到pos号车位进行泊车endl; coutendl; else pos=pushqueue(cq,cnum,ctime); cout该停车场已满,请将车停到便道pos号车位上endl; coutendl; 3.1进入停车场函数 int parkingmanagement:pushstack(carstack &cs,int cnum,double ctime) if(cs.top=Max-1) cout停车场已满!endl; return Max; else cs.top+; (cs.scs.top).number=cnum; (c

5、s.scs.top).time=ctime; return (cs.top+1); 4、离开停车场void parkingmanagement:leave(carstack &cs,carqueue &cq,int cnum,double ctime) int i,flag(0),pstack,count(1),outcarnum; double hour; car *p; for(i=0;i=cs.top;i+) if(cs.si).number=cnum) flag=1; break; if(flag) popstack(cs,cnum); hour=ctime-popstacktime;

6、outcarnum=popqueue(cq);/pstack=pushstack(cs,outcarnum,ctime); cout该车在本停车场内停留时间为hour分钟,应付金额hour*(price/60)元!next; if(p-number=cnum) deletequeue(cq,count); if(countMax) cout您的车在便道上的位置为count号车位,请自行驶离,无需付费!endl; break; if(p=NULL) cout您的车不在本停车场内,或输入有误,请重新输入!endl; 5、详细设计5.1函数的调用关系 如下图:主函数 有车离开则进入 判断停车场是否满

7、 full() 满则进入等候队列 图5.11 函数调用5.2主要算法的流程图等候便道pos=pushqueue(cq,cnum,ctime);图5.22主要算法图6、软件说明:6.1使用环境:Visual C+ 6.0.操作要求:程序运行后,用户根据所要进行的操作选择是进入停车场还是离开停车场并输入车牌号和时间6.2测试图:程序开始运行: 图 6.1 程序主界面进入停车场输入选项和车牌号和时间:图6.2 进入停车场离开停车场输入D 车牌号 时间:(根据车牌号找到相应的车)图6.3离开停车场显示结果 7、总结在这一次的实训中才知道什么叫做真真正正的体会到什么叫做你看得懂程序听得懂课拿着中上的成绩

8、你就口可以说你懂数据结构懂C+懂C了,无数次在修改代码无数次在询问老师问题同学问题,每一次编译错误减少一小个心里乐得跟开了花似的。非常的感谢同学和老师在QQ上不厌其烦的一次又一次的回答我的问题哪怕是一个马虎的分号的错误。正所谓勤能补拙往后的我要更加的努力去学习了。附录:程序代码#includeusing namespace std; const int Max=10;const double price=30;class car public: double time; int number; car *next;class carstack friend class parkingmanag

9、ement; public: carstack(); int empty(); int full(); car *s; int top;carstack:carstack() top=-1; s=new carMax; if(s=NULL) cout栈空间分配不成功!endl; exit(1); int carstack:full() return top=Max-1;class carqueue friend class parkingmanagement; public: carqueue(); int full(); car *front,*rear;carqueue:carqueue(

10、) rear=front=NULL;class parkingmanagement public: int pushstack(carstack &cs,int cnum,double ctime); void popstack(carstack &cs,int cnum); int pushqueue(carqueue &cq,int cnum,double ctime); int popqueue(carqueue &cq); void arrival(carstack &cs,carqueue &cq,int cnum,double ctime); void leave(carstack

11、 &cs,carqueue &cq,int cnum,double ctime); void deletequeue(carqueue &cq,int i); int popstacknumber; double popstacktime;int parkingmanagement:pushstack(carstack &cs,int cnum,double ctime) if(cs.top=Max-1)/Max从1开始,top从0开始 cout停车场已满!endl; return Max; else cs.top+; (cs.scs.top).number=cnum; (cs.scs.top

12、).time=ctime; return (cs.top+1); void parkingmanagement:popstack(carstack &cs,int cnum) int i; car p; carstack stemp; for(i=0; ii) stemp.s+(stemp.top)=cs.s(cs.top)-; popstacknumber=p.number;int popstacknumber() popstacktime=p.time;double popstacktime() cs.top-; while(stemp.top=0) cs.s+(cs.top)=stemp

13、.s(stemp.top)-;int parkingmanagement:pushqueue(carqueue &cq,int cnum,double ctime) car *p,*countp; int count(1); p=new car; p-number=cnum; p-time=ctime; p-next=NULL; if (cq.front=NULL) cq.front=cq.rear=p; else p-next=(cq.rear)-next; (cq.rear)-next=p; cq.rear=(cq.rear)-next; countp=(cq.front)-next; w

14、hile(countp!=NULL) count+; countp=countp-next; return count;int parkingmanagement:popqueue(carqueue &cq) car p; if(cq.front!=NULL) p.number=(cq.front)-next)-number; p.time=(cq.front)-next)-time; p.next=(cq.front)-next)-next; return p.number;void parkingmanagement:arrival(carstack &cs,carqueue &cq,in

15、t cnum,double ctime) int pos; if(!(cs.full() int fl(0),i; for(i=0;i=cs.top;i+) if(cs.si.number=cnum) fl=1; break; if(fl=1) cout输入错误!请重新输入!如果到达的车的车牌号!=栈内已有车辆的车牌号endl; Else pos=pushstack(cs,cnum,ctime);/入栈,返回车位信息 cout该停车场还有空位,请到pos号车位进行泊车endl; coutendl; Else pos=pushqueue(cq,cnum,ctime); cout该停车场已满,请将

16、车停到便道pos号车位上endl; coutendl; void parkingmanagement:leave(carstack &cs,carqueue &cq,int cnum,double ctime) int i,flag(0),pstack,count(1),outcarnum; double hour; car *p; for(i=0;i=cs.top;i+) if(cs.si).number=cnum) flag=1; break; if(flag) popstack(cs,cnum); hour=ctime-popstacktime; outcarnum=popqueue(c

17、q); pstack=pushstack(cs,outcarnum,ctime); cout该车在本停车场内停留时间为hour分钟,应付金额hour*(price/60)元!next; if(p-number=cnum) deletequeue(cq,count); if(countMax) cout您的车在便道上的位置为count号车位,请自行驶离,无需付费!endl; break; if(p=NULL) cout您的车不在本停车场内,或输入有误,请重新输入!endl; void parkingmanagement:deletequeue(carqueue &cq,int i) car *p

18、,*q; int j(0); p=cq.front; while(p & jnext; j+; if(!p | !p-next) coutnext; p-next=q-next; delete q; void print() cout= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =endl; cout= 欢迎光临! =endl; cout= =endl; cout= 本停车场收费标准为:30元/小时;车库容量为:10 =endl; cout= =endl; cout= 请输入您的泊车信息:格式为:(到达/

19、离去/退出);车牌号;现在时刻 =endl; cout= 其中,A:到达;D:离去;E:退出系统 =endl; cout= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =acccarnumcartime; if(acc=A) park.arrival(cars,carq,carnum,cartime); else if(acc=D) park.leave(cars,carq,carnum,cartime); else if(acc=E) break; else cout您的输入有误,请重新输入!endl;

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2