系列文章目录
` 提示:
5. Heather 银行进行的研究表明,ATM 客户不希望排队时间不超过1分钟。使用程序清单 12.10中的模拟,找出要使平均等候时间为1分钟,每小时到达的客户数应为多少(试验时间不短于100小时)?
提示:写完文章后,目录可以自动生成,如何生成可参考右边的帮助文档
前言
提示:这里可以添加本文要记录的大概内容:
Heather 银行进行的研究表明,ATM 客户不希望排队时间不超过1分钟。使用程序清单 12.10中的模拟,找出要使平均等候时间为1分钟,每小时到达的客户数应为多少(试验时间不短于100小时)?
提示:以下是本篇文章正文内容,下面案例可供参考
一、序求
修改程序清单12.10中模拟的程序。
二、程序清单引入
1.头文件
代码如下(示例):
// queue.h -- interface for a queue
#ifndef QUEUE_H_
#define QUEUE_H_
// This queue will contain Customer items
class Customer
{
private:
long arrive; // arrival time for customer
int processtime; // processing time for customer
public:
Customer() : arrive(0), processtime (0){
}
void set(long when);
long when() const {
return arrive; }
int ptime() const {
return processtime; }
};
typedef Customer Item;
class Queue
{
private:
// class scope definitions