停车场管理系统代码.docx
- 文档编号:4151144
- 上传时间:2022-11-28
- 格式:DOCX
- 页数:22
- 大小:17.85KB
停车场管理系统代码.docx
《停车场管理系统代码.docx》由会员分享,可在线阅读,更多相关《停车场管理系统代码.docx(22页珍藏版)》请在冰豆网上搜索。
停车场管理系统代码
#include
#include
#include
#defineMaxChe3
#defineChefei0.5
usingnamespacestd;
classTime
{
public:
intyear;
intmouth;
intday;
inthour;
intminute;
intsecond;
voidsetTime()
{
cout<<"Time"< cout<<"year: "; cin>>year; cout<<"mouth: "; cin>>mouth; cout<<"day: "; cin>>day; cout<<"hour: "; cin>>hour; cout<<"minute: "; cin>>minute; cout<<"second: "; cin>>second; } voidshowTime() { cout< } }; classChe{ public: stringID; stringColor; stringCheXing; TimeaTime; Che*Next; Che(){} voidSet() { cout<<"ID="; cin>>ID; cout<<"Color="; cin>>Color; cout<<"CheXing=(xiaoqichexiaokazhongkadaka)"< cin>>CheXing; aTime.setTime(); } voidshow() { cout< cout< cout< aTime.showTime(); } ~Che(){} }; voidShouye();//首页 voidInput();//车辆进入停车场 voidOutput();//车辆离开停车场并计算停车费用 voidChaxun();//按车牌查询停车信息 voidXianshi();//显示车库中的车辆信息 voidTongji();//统计车库中的车 voidBianji();//修改车库中的车的信息 voidCuo1();// voidmain() { Shouye(); } voidShouye()//首页 { inti; cout<<"**************************\n"; cout<<"\t"<<"1.汽车进停车场\n"; cout<<"\t"<<"2.汽车出停车场\n"; cout<<"\t"<<"3.汽车信息查询\n"; cout<<"\t"<<"4.显示所有汽车\n"; cout<<"\t"<<"5.汽车信息统计\n"; cout<<"\t"<<"选择操作: "; cin>>i; switch(i) { case1: { system("cls"); Input(); break; } break; case2: { system("cls"); Output(); break; } break; case3: { system("cls"); Chaxun(); break; } break; case4: { system("cls"); Xianshi(); break; } break; case5: { system("cls"); Tongji(); break; } break; default: { cout<<"无此选项! "< cout<<"1.返回首页从新选择"< stringh; cin.clear(); cin>>h; if(h=="1") { system("cls"); Shouye(); } else{ Cuo1(); } } } } voidInput()//车辆进入停车场 { ifstreamfin("text.txt",ios: : in); if(! fin) { cout<<"文件打开失败! "< } inti; fin>>i; cout<<"停车场中已有车"< Chep[MaxChe]; for(intj=0;j { fin>>p[j].ID>>p[j].Color>>p[j].CheXing>>p[j].aTime.year>>p[j].aTime.mouth >>p[j].aTime.day>>p[j].aTime.hour>>p[j].aTime.minute>>p[j].aTime.second; cout< < "< "< } fin.close(); if(i { cout<<"车辆可以进入停车场"< p[i].Set(); ofstreamfout("text.txt",ios: : out); fout< for(intj=0;j { fout< <<"\t"< } fout.close(); cout<<"***************************************************"< cout<<"1.继续停车"< cout<<"2.返回首页"< inth; cin>>h; if(h==1) Input(); if(h==2) { system("cls"); Shouye(); } if(h! =1&&h! =2) Cuo1(); } else { cout<<"****************************************************"; cout<<"停车场已满! "< cout<<"1.返回首页"< inth; cin>>h; if(h==1) { system("cls"); Shouye(); } else Cuo1(); } } voidOutput()//车辆离开停车场并计算停车费用 { ifstreamfin("text.txt",ios: : in); if(! fin) { cout<<"文件打开失败! "< } inti; fin>>i; cout<<"停车场中已有车"< Chep[MaxChe]; for(intj=0;j { fin>>p[j].ID>>p[j].Color>>p[j].CheXing>>p[j].aTime.year>>p[j].aTime.mouth >>p[j].aTime.day>>p[j].aTime.hour>>p[j].aTime.minute>>p[j].aTime.second; cout< < "< "< } fin.close(); if(i! =0) { stringcp; cout<<"按车牌查询"< cout<<"离开停车场车牌: "; cin>>cp; cout<<"出场时间"< TimebTime; bTime.setTime(); ofstreamfout("text.txt",ios: : out); fout< for(j=0;j { if(p[j].ID==cp) { cout<<"*************************************************************"< cout<<"该车进入停车场时间为: "; cout< < "< "< cout<<"每分钟"< intmoney; money=(bTime.year-p[j].aTime.year)*12*31*24*60+(bTime.mouth-p[j].aTime.mouth)*31*24*60+(bTime.day-p[j].aTime.day)*24*60+(bTime.hour-p[j].aTime.hour)*60+(bTime.minute-p[j].aTime.minute)*10; cout<<"共计:
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 停车场 管理 系统 代码