停车场Word格式文档下载.docx
《停车场Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《停车场Word格式文档下载.docx(8页珍藏版)》请在冰点文库上搜索。
![停车场Word格式文档下载.docx](https://file1.bingdoc.com/fileroot1/2023-5/9/8d3ab432-3d23-412d-a7c3-5dc609554041/8d3ab432-3d23-412d-a7c3-5dc6095540411.gif)
⑶程序所能达到的功能
实现停车场的管理,输入车牌号码,将此车停入停车站,并展示出来,在另一个编辑框中输入车牌号,将此车开出停车站。
若停车站已满,则在便道中展示出来。
(4)测试数据:
停车牌号:
123车库:
123便道:
(空)
12341234
出车牌号:
1234车库:
(空)出车情况:
1234
三、程序流程图略
四、数据结构及算法描述
数据结构
ypedefstructparting
{
CStringchepai;
clock_tstart;
}PART;
typedefstructwaiting
clock_tstart,finish;
structwaiting*next;
}WAIT;
typedefstruct
WAIT*front,*rear;
}Lwait;
算法描述
BOOLCpart:
:
add(CStringchepai)
BOOLflg=true;
if(i>
=N)flg=false;
else
{
parting[i].chepai=chepai;
parting[i].start=clock();
i++;
}
returnflg;
}
voidCpart:
display(CListBox*list)
CStringstr,xs;
list->
ResetContent();
InsertString(0,"
车位车牌号"
);
for(intm=0;
m<
i;
m++)
{
str="
"
;
xs.Format("
%-3d"
m);
str+=xs+"
"
xs=parting[m].chepai;
str+=xs;
InsertString(m+1,str);
adding(CStringchepai)
if(q->
front->
next==NULL)
{
WAIT*p=newWAIT;
p->
next=NULL;
q->
front=q->
rear=p;
p=newWAIT;
chepai=chepai;
rear->
next=p;
disp(CListBox*list)
车牌号"
intm=0;
for(WAIT*p=q->
next;
p;
p=p->
next)
str="
xs.Format("
%s"
p->
chepai);
str+=xs;
InsertString(++m,str);
//DELvoidCpart:
del(intn)
//DEL{
//DEL
//DEL}
//DELWAIT*Cpart:
head()
pop()
{
parting[i].chepai=head->
next->
chepai;
parting[i].start=head->
start;
i++;
WAIT*p;
p=head->
head->
next=p->
deletep;
push()
i--;
chepai=parting[i].chepai;
start=parting[i].start;
next=head->
out()
parting[i].chepai=q->
parting[i].start=clock();
WAIT*m=q->
next=m->
deletem;
push2()
WAIT*m;
m=newWAIT;
m->
finish=clock();
p2->
next=m;
p2=m;
disp2(CListBox*list)
车牌号停车时间停车收费"
for(WAIT*mm=head2->
mm;
mm=mm->
%-s"
mm->
%6ds"
((mm->
finish-mm->
start)/1000));
str+="
+xs;
%6.2f元"
start)/1000)*0.003);
str+="
五、调试分析
⑴出站函数难以实现,通过老师的帮助得以解决。
⑵算法时间复杂度:
O(n).
⑶改进思想:
导入图片,便于直观理解。
⑷经验体会:
平时要多读程序,注意和老师同学交流。
六、使用说明
在“停车牌号”处连续输入车牌号,单击“停车”按钮,可使此车挺入停车站,若停车站已满则停入便道。
在“出车牌号”处输入车牌号,单击“出车”按钮,当没有此车时,可见提示框“没有此车”,若有此车,可见“停车站”“便道”和“停车情况”列表框实现相应变化
七、测试结果
停车牌号:
12341234
出车牌号:
12
1234512345
12
12345s0.01元
12345
12