收藏 分销(赏)

停车场管理.ppt

上传人:精*** 文档编号:2404135 上传时间:2024-05-29 格式:PPT 页数:8 大小:215.50KB 下载积分:6 金币
下载 相关 举报
停车场管理.ppt_第1页
第1页 / 共8页
停车场管理.ppt_第2页
第2页 / 共8页


点击查看更多>>
资源描述
1停车场管理2程序文件n源文件(.cpp文件)main.cppn头文件(.h文件)lk_stack.hlk_list.hnode.hutility.hvehiclestop.h3文件视图4main.cpp文件int main(void)int maxnum,rate;char ch;coutmaxnumrate;StoppingPlace myStoppingPlace(maxnum,rate);VehicleType veArrive,veLeave;while(ch!=4)coutendl1.车辆到达;coutendl2.车辆离开;coutendl3.显示状态;coutendl4.结束;coutendlch;5main.cpp文件switch(ch)case1:coutveArrive.numveArrive.time;myStoppingPlace.Arrive(veArrive);break;case2:coutveLeave.numveLeave.time;myStoppingPlace.Leave(veLeave);break;case3:myStoppingPlace.DisplayStatus();break;return 0;6vehiclestop.h文件,包含VehicleType结构体说明和StoppingPlace类声明和接口函数,以及重载的Write函数#include lk_stack.h#include lk_list.hstruct VehicleTypeunsigned int num;unsigned int time;void Write(const struct VehicleType&e)/这里对utility提供的Write函数进行了重载/操作结果:显示数据元素 cout(e.num,e.time);7vehiclestop.h文件,包含VehicleType结构体说明和StoppingPlace类声明和接口函数,以及重载的Write函数class StoppingPlaceprivate:LinkStack*pStopPath;LinkList*pShortcutPath;int maxNumOfStopVehicle;int rate;bool ExistVehicleInStopPath(const VehicleType&vehicle)const;int LocateInpShortcutPath(const VehicleType&vehicle)const;public:StoppingPlace(int n,int r);/构造函数,这个要自己写virtual StoppingPlace();/这里要增加一对花括号void DisplayStatus()const;void Arrive(const VehicleType&vehicle);void Leave(const VehicleType&vehicle);8StoppingPlace类的构造函数StoppingPlace:StoppingPlace(int n,int r)maxNumOfStopVehicle=n;rate=r;pStopPath=new LinkStack;pShortcutPath=new LinkList;
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服