-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteller.cpp
47 lines (41 loc) · 908 Bytes
/
teller.cpp
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
36
37
38
39
40
41
42
43
44
45
46
/*
* PA4_the_murder - Jacob Tutlis - jjtutlis - James Taylor - jrtaylor
* Created on: Feb 12, 2018
* Author: jjtutlis
*/
#include <iostream>
#include "teller.h"
/**
* Constructor for teller class
* generates random idle time
*/
Teller::Teller(){
// generates random idle time between 0 - 160 minutes
// converts to minutes
idleTime = (rand() % IDLE_MAX) / 60;
activeTime = -1;
}
/**
* getter for active time
* @return activeTime
*/
int Teller::getActiveTime(){
return activeTime;
}
/**
* getter for idleTime
* @return idleTime
*/
int Teller::getIdle(){
return idleTime;
}
/**
* Sets active time to the current global time + the time
* of the current action the teller is doing
* @param currentTime current global time
* @param addTime time of the action of the teller
* @return void
*/
void Teller::setActiveTime(int currentTime){
activeTime = currentTime + idleTime;
}