carwash.h

来自「一个模拟洗车场的小程序」· C头文件 代码 · 共 49 行

H
49
字号
#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 + =
减小字号Ctrl + -
显示快捷键?