-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPmp.cpp
More file actions
35 lines (33 loc) · 920 Bytes
/
Pmp.cpp
File metadata and controls
35 lines (33 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# include "Pmp.h"
Bank::Bank(int Global,bool b)
{
globalTime=Global;
operatingStatus=b;
waitSum=0;
numOfCustomers=0;
Line;
}
void Bank::Arrive(Customers c)
{
Line.push(c);
numOfCustomers++;
std::cout<<"Customer "<<c.getId()<<" has enetered the bank at time "<<c.getArriveTime()<<std::endl;
}
void Bank::Depart()
{
if(!(Line.empty()))
{
Customers s=Line.front();
std::cout<<"Customer "<<s.getId()<<" has left the bank at time "<<globalTime<<std::endl<<"The Wait Time for customer "<<s.getId()<<" is: "<<globalTime-s.getArriveTime()-s.getServiceTime()<<" Units"<<std::endl;
waitSum+=(globalTime-s.getArriveTime()-s.getServiceTime());
Line.pop();
return;
}
std::cout<<"There is no one in Line"<<std::endl;
}
Customers::Customers(int t,int i,int st)
{
arriveTime=t;
id=i;
serviceTime=st;
}