📄 carwash.h
字号:
#ifndef CAR_WASH
#define CAR_WASH
#include <string>
#include <queue>
#include <iostream>
#include "Car.h"
using namespace std;
class CarWash
{
public:
//Postcondition:this CarWash has been initialized.
CarWash();
//Postcondition:all of the arrivals and departures for this CarWash have been processed.
void runSimulation();
//Postcondition:the average waiting time,or am error message,has been printed.
void printResult();
int get_rand(int meanTime);
int get_mean();
protected:
const static int INFINITY;//indicates no car being washed
const static int MAX_SIZE;//maximum cars allowed in carQueue
const static int WASH_TIME;//minutes to wash one car
void processDepature(queue <Car>& catQueue);
void processArrival(int nextArrivalTime,queue<Car>& carQueue);
int currentTime,
nextDepartureTime,
numberOfCars,
sumOfWaitingTimes,
meanServiceTime;
};//class CarWash
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -