南昌大学实验报告
学生姓名:
学
号:610
专业班级:自动化班
实验类型:□ 验证 □ 综合■ 设计 □ 创新 实验日期:
实验成绩:
小区停车位管理
1.实验要求
建立一个停车场模拟的收费管理系统,需为其设计一个功能的界面式菜单,通过菜单对其各项功能一目了然,并通过if条件选择结构的设计,对各项功能按模块实现,并用while循环语句对各个模块完美的配合实现其界面的循环和跳转,并运用的C++中的特有的string、bool型数据,使得程序的设计更加完美。系统需要模拟停车场的管理功能及收费功能。各项功能模块如下:
1、车辆驶入
2、车辆驶离
3、整体查询
4、车位查询
5、车牌查询
6、系统帮助
7、总计收费
8、退出系统
2.实验环境
VC++6.0 3.程序
#include #include #include using namespace std; const int s=105; void main() {int i,j,k,m,n,t,x,y;char e;long z;int a[s]={0},b[s]={0},g[s]={0}; string c[s];bool f,ff;i=0;m=0;z=0;f=true;cout
|| \"
版权所有者:汪志成
|| \"
二○一二年正月初一
|| \"
|| \">n; if(n>0&&n>e;if(e==\'N\'||e==\'n\') f=true; else if(e==\'Y\'||e==\'y\') cout
cout
cout
|| \"
cout
1、车辆驶入
2、车辆驶离
3、整体查询 || \"
cout
4、车位查询
5、车牌查询
6、系统帮助 || \"
cout
7、总计收费
8、退出系统
|| \"
cout
|| \"
cout
收费说明:6元/小时,1角/分钟
|| \"
cout
成成停车场 --- 竭诚为您服务!
|| \"
cout
|| \"
cout
cout>k; if(k==8) {ff=true;while(ff){ff=false;cout>e; if(e==\'Y\'||e==\'y\') cout
else {cout
cin>>a[i];cout>b[i];if(a[i]23||b[i]59) cout
else {cout>c[i];
for(j=1;j
cout
cout
if(b[i]>9) cout
||
\"
||\"
else cout
||
\"
||\"
cout
t=j;a[t]=a[i];b[t]=b[i];c[t]=c[i];j=n+1;}}}
else cout
f=true;} else if(k==2){if(m==0) cout
else {cout>x;cout>y;
cout>t;
if(t0&&x>=a[t]){if(g[t]==0||(x==a[t]&&y
else {m=m-1;
cout
cout
|| 应收费用 || \"
if(b[t]>9) cout
||
\"
|| \";
else cout
||
\"
|| \";
if(y>9) cout
|| \"; else cout
|| \";
if(y==b[t]){cout
|| \"
else if(y>b[t]){cout
|| \"
else {cout
|| \"
cout
g[t]=0;c[t]=\"0\";}}
else if(t==0) {cout>c[102];
for(j=1;ja[j]||(x==a[j]&&y>b[j]))) {m=m-1;t=j;j=n+1;
cout
cout
|| 应收费用 || \"
if(b[t]>9) cout
||
\"
|| \";
else cout
||
\"
|| \";
if(y>9) cout
|| \"; else cout
|| \";
if(y==b[t]){cout
|| \"
else if(y>b[t]){cout
|| \"
else {cout
|| \"
cout
else if(j==n) cout
else if(x
else cout
f=true;} else if(k==3){
cout
cout
||
车牌号
|| 驶入时间 || \"
for(j=1;j
(无) || \"
else {cout
\"
||
\";
if(b[j]>9) cout
else cout
cout
cout
总
|| \"
||
\"
cout
计
|| \"
||
\"
cout
f=true;} else if(k==4){cout>t;
if(t>n||t
else {cout
cout
||
车牌号
|| 驶入时间 || \"
if(g[t]==0) cout
(无)
|| \"
else {cout
\"
||
\";
if(b[t]>9) cout
else cout
cout
f=true;} else if(k==5){cout>c[102];
for(j=1;j
cout
cout
if(b[j]>9) cout
||
\"
||\"
else cout
||
\"
||\"
cout
else if(j==n) cout
f=true;} else if(k==6) {cout
cout
||\"
cout
||\"
||\"
1、本系统需要先设置车位数,车位数为1-100之间;
||\"
2、成成停车场最低收费1元,超过1角均按1元收费;
||\"
3、时间输入:先输入的为小时,后输入的为分钟;
||\"
4、车牌输入:先输入一个字母,后输入一串数字;
||\"
cout
5、车辆驶离:当输入车位号为0时,转入车牌驶离;
||\"
6、车辆停留时间最长为一天,驶离时间应大于驶入时间;
||\"
||\"
cout>e;cout
cout
cout
|| \"
cout