1停车场系统代码文档格式.docx
《1停车场系统代码文档格式.docx》由会员分享,可在线阅读,更多相关《1停车场系统代码文档格式.docx(22页珍藏版)》请在冰豆网上搜索。
day:
day。
hour:
hour。
minute:
minute。
second:
second。
}
voidshowTime(>
year<
mouth<
day<
hour<
minute<
}。
classChe{
stringID。
stringColor。
stringCheXing。
TimeaTime。
Che*Next。
Che(>
{}
voidSet(>
{
ID="
ID。
Color="
cin>
Color。
CheXing=(xiaoqichexiaokazhongkadaka>
CheXing。
aTime.setTime(>
voidshow(>
aTime.showTime(>
~Che(>
voidShouye(>
//首页
voidInput(>
//车辆进入停车场
voidOutput(>
//车辆离开停车场并计算停车费用
voidChaxun(>
//按车牌查询停车信息
voidXianshi(>
//显示车库中的车辆信息
voidTongji(>
//统计车库中的车
voidBianji(>
//修改车库中的车的信息
voidCuo1(>
//
voidmain(>
Shouye(>
}
inti。
cout<
**************************\n"
\t"
1.汽车进停车场\n"
2.汽车出停车场\n"
3.汽车信息查询\n"
4.显示所有汽车\n"
5.汽车信息统计\n"
选择操作:
i。
switch(i>
case1:
{
system("
cls"
Input(>
break。
}
break。
case2:
Output(>
case3:
Chaxun(>
case4:
Xianshi(>
case5:
Tongji(>
default:
cout<
无此选项!
1.返回首页从新选择"
stringh。
cin.clear(>
cin>
h。
if(h=="
1"
{
system("
Shouye(>
}
else{
Cuo1(>
}
ifstreamfin("
text.txt"
ios:
:
in>
if(!
fin>
文件打开失败!
fin>
停车场中已有车"
i<
辆"
Chep[MaxChe]。
for(intj=0。
j<
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。
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<
fin.close(>
if(i<
MaxChe>
车辆可以进入停车场"
p[i].Set(>
ofstreamfout("
out>
fout<
i+1<
for(intj=0。
i+1。
{
fout<
\n"
}
fout.close(>
***************************************************"
1.继续停车"
2.返回首页"
inth。
if(h==1>
Input(>
if(h==2>
system("
Shouye(>
if(h!
=1&
&
h!
=2>
Cuo1(>
else
****************************************************"
停车场已满!
1.返回首页"
else
if(i!
=0>
stringcp。
按车牌查询"
离开停车场车牌:
cp。
出场时间"
TimebTime。
bTime.setTime(>
i-1<
for(j=0。
if(p[j].ID==cp>
*************************************************************"
该车进入停车场时间为:
<
每分钟"
Chefei<
元钱"
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。
共计:
money<
inta。
a=j。
for(j=0。
a。
fout<
<
for(intj=a+1。
离场成功*******************"
inth。
if(h==1>
else
break。
停车场中无车"
1.车辆进入停车场"
Input(>
{
stringcx。
车牌号:
cx。
if(p[j].ID==cx>
*****"
1.删除该车信息"
2.修改该车信息"
3.返回首页"
ofstreamfout("
inta。
a=j。
for(j=0。
{
fout<
<
}
for(intj=a+1。
fout.close(>
cout<
删除成功!
into。
cin>
o。
if(o==1>
system("
Shouye(>
else
Cuo1(>
if(h==2>
******************************"
1.修改单种信息"
2.修改多种信息"
inth。
if(h==1>
cout<
1.修改车牌"
2.修改车色"
3.修改车型"
4.修改车辆入场时间"
into。
cin>
if(o==1>
{
cout<
ID:
cin>
p[j].ID。
}
if(o==2>
Color"
p[j].Color。
if(o==3>
CheXing"
p[j].CheXing。
if(o==4>
year"
p[j].aTime.year。
mouth"
p[j].aTime.mouth。
day"
p[j].aTime.day。
hour"
p[j].aTime.hour。
minute"
p[j].aTime.minute。
second"
if(o!
o!
=2&
=3&
=4>
Cuo1(>
break。
if(h==2>
if(h!
=3>
i-1。
if(h==3>
if(h!