#include<iostream>
#include<string>
#include<conio.h>
#include "entry.h"
#include "lane.h"
#include "out.h"
#include "car.h"
using namespace std;
int main() {
Car cars[10] = { Car("1","#88","11L"),Car("2", "#99", "22L"),Car("3", "#77", "33L"),//数据声明
Car("4","#88","11L"),Car("5", "#99", "22L"),Car("6", "#77", "33L"),
Car("7","#99","11L"),Car("8", "#99", "22L"),Car("9", "#77", "33L"),
Car("10","#88","11L")
};
Entry entry;
Out out;
Lane lanes[4] = { Lane("a","#88", "#99"),Lane("b","#77", "#99"),Lane("c","#88", "#77"),Lane("d","#88", "#99") };
for (int i = 0; i < 10; i++) {
entry.push(cars[i]);
entry.getInfo(cars[i]);
}
cout << "您可按下列按键进行对应操作" << endl;
cout <<" g:一辆车进入加油车道 q:退出" << endl;
cout << "1:a车道加油 2:b车道加油 3:c车道加油 4:d车道加油"<< endl;
cout << "查看状态 i:入口 a:a车道 b:b车道 c:c车道 d:d车道 o:出口"<<endl;
int index = 0;
while (true) {
fflush(stdin);
int getch();
int input = getch();
if (input == 'i') {
entry.displayInfo();
}
else if (input == 'a') {
lanes[0].displayInfo();
}
else if (input == 'b') {
lanes[1].displayInfo();
}
else if (input == 'c') {
lanes[2].displayInfo();
}
else if (input == 'd') {
lanes[3].displayInfo();
}
else if(input == 'o') {
out.displayInfo();
}
else if (input == '1') {
Car* car=lanes[0].addGas();
out.push(*car);
}
else if (input == '2') {
Car* car = lanes[1].addGas();
out.push(*car);
}
else if (input == '3') {
Car* car = lanes[2].addGas();
out.push(*car);
}
else if (input == '4') {
Car* car = lanes[3].addGas();
out.push(*car);
}
else if (input == 'g') {
Lane* lane = cars[index].ChooseLane(lanes);
Car* car = entry.pop();
lane->push(*car);
index++;
}
else if(input == 'q'){
cout << "您已退出,谢谢使用" << endl;
break;
}
else {
cout << "您的输入不合法" << endl;
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
数据结构课程设计-基于C++编写的汽车加油站模拟系统.zip
共58个文件
tlog:12个
h:10个
log:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 197 浏览量
2022-07-10
00:12:39
上传
评论
收藏 8.15MB ZIP 举报
温馨提示
数据结构课程设计-基于C++编写的汽车加油站模拟系统.zip 计算机专业,软件工程专业,通信工程大学生课程设计 自己大三的时候写的 适合大家做课程设计,写毕业设计也可以参考 基于C++的课程设计
资源推荐
资源详情
资源评论
收起资源包目录
数据结构课程设计-基于C++编写的汽车加油站模拟系统.zip (58个子文件)
gas_station-master
.vs
gas_station
v14
.suo 26KB
gas_station.sln 1KB
gas_station.VC.db 10.88MB
Debug
.vs
gas_station
v14
.suo 6KB
gas_station.ilk 450KB
gas_station.pdb 1.57MB
gas_station.exe 75KB
gas_station
.vs
gas_station
v14
.suo 47KB
gas_station.sln 1KB
lane.h 301B
entry.h 133B
gas_station.VC.db 11MB
main.cpp 314B
out.h 196B
gas_station.vcxproj 7KB
car.h 689B
Debug
.vs
gas_station
v14
.suo 6KB
vc140.pdb 404KB
gas_station.ilk 832KB
gas_station.pdb 1.34MB
vc140.idb 355KB
gas_station.exe 83KB
gas_station.tlog
CL.write.1.tlog 1KB
CL.read.1.tlog 22KB
unsuccessfulbuild 0B
gas_station.lastbuildstate 198B
CL.command.1.tlog 1KB
link.write.1.tlog 470B
link.command.1.tlog 1KB
link.read.1.tlog 3KB
gas_station.log 328B
queue.h 1KB
gas_station
lane.h 288B
car.cpp 595B
entry.h 678B
x64
Debug
gas_station.log 689B
main.cpp 2KB
out.h 509B
lane.cpp 666B
gas_station.vcxproj 7KB
car.h 286B
Debug
vc140.pdb 444KB
gas_station.Build.CppClean.log 726B
main.obj 196KB
vc140.idb 659KB
car.obj 149KB
lane.obj 163KB
gas_station.tlog
CL.write.1.tlog 3KB
CL.read.1.tlog 33KB
gas_station.lastbuildstate 191B
CL.command.1.tlog 4KB
link.write.1.tlog 628B
link.command.1.tlog 3KB
link.read.1.tlog 3KB
gas_station.log 88B
queue.h 921B
gas_station.vcxproj.filters 2KB
gas_station.vcxproj.filters 1KB
共 58 条
- 1
资源评论
我慢慢地也过来了
- 粉丝: 6529
- 资源: 3999
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 驱动代码驱动代码驱动代码驱动代码
- SVID_20240523_141155_1.mp4
- Code for the complete guide to tkinter tutorial
- 关于百货中心供应链管理系统.zip
- SimpleFolderIcon-master 修改Unity的Project下的文件夹图标
- A python Tkinter widget to display tile based maps
- A pure Python library for adding tables to a Tkinter application
- Vector资源文件.zip
- MobaXterm-Installer
- 88-520告白(520气球).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功