#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include "car.h"
using namespace std;
int main() {
freopen("in.txt", "r", stdin);
int n;
cout << " **************停车场管理系统**************" << endl;
cout << endl;
cout << "停车场管理系统说明:" << endl;
cout << "1.当停车场车位已满之后,车将会停在候车道" << endl;
cout << "2.停车场按照每小时五元的标准收费(不足一小时按照一小时计算)"
<< endl;
cout << "3.停在候车道的车辆不收费" << endl;
cout << "4.停车场只有10个位置" << endl;
cout << "5.候车道只有10个位置" << endl;
cout << endl;
cout << " *********操作说明*********" << endl;
cout << endl;
cout << "车辆驶入登记->请按1 ^_^ 车辆驶出登记->请按2 ^_^" << endl;
cout << endl;
cout << "查询停车场的停车状态->请按3 ^_^ 查询停车场空闲车位->请按4 ^_^ "
<< endl;
cout << endl;
cout << "退出停车场管理系统->请按0 ^_^" << endl;
cout << endl;
cout << "说明完毕!下面开始操作" << endl;
cout << endl;
ParkingLot P(2, 11);
while (1) {
cout << "********请选择操作1~4或者退出按0********" << endl;
cout << endl;
int t;
cin >> t;
if (t == 1) {
Car car;
P.Push(car);
} else if (t == 2) {
Car car;
P.Pop(car);
} else if (t == 3) {
for (int i = 0; i < P.stopNum; i++) {
P.Query(i);
}
} else if (t == 4)
P.QueryCarState();
else
break;
cout << endl;
cout << "**********************************************" << endl;
cout << "**********************************************" << endl;
cout << endl;
}
cout << "欢迎使用停车场管理系统,期待您的下次使用^_^" << endl;
}
没有合适的资源?快使用搜索试试~ 我知道了~
停车场管理系统的设计与实现
共2个文件
cpp:1个
h:1个
需积分: 50 15 下载量 107 浏览量
2019-07-11
09:42:23
上传
评论 9
收藏 3KB RAR 举报
温馨提示
• 【问题描述】 假设停车场是个多个双向通道,设计一个简易的停车场收费系统管理车辆的进出及等候停车操作,并计算停车费用。 • 【基本要求】 1、停车及计时:按照停车通道序号进行停车(停车的车道和车位从小到大),停车成功后开始计时(只需记录整时); 2、离开及收费:当车辆离开时,留出车位,并收取停车费用,并及时输出空车位状态; 3、停车状况查询:依次输出各停车通道的停车状况; 4、等候停车:如果没有停车位,车辆在等候队列排队等候停车(如果候车队列已满,则给出禁止停车信息)。如有空位后,则退出等候队列,进入停车通道,开始计费。 5、各种操作提示明确。 • 【测试数据】 对输入数据要有合法和非法约定输出格式 • 【实现要求】 1. 车道信息包括:车道号、车位数以及停车位信息 2. 停车位信息包括:车位号和车辆信息(包括车牌号、停车时间) 3. 选择合适的计时算法。
资源推荐
资源详情
资源评论
收起资源包目录
Park.rar (2个子文件)
Park
main.cpp 2KB
Car.h 5KB
共 2 条
- 1
资源评论
weixin_40006090
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功