-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPriorityCustomer.java
More file actions
34 lines (27 loc) · 880 Bytes
/
PriorityCustomer.java
File metadata and controls
34 lines (27 loc) · 880 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
/*
PCreates a Customer object to be used in the line queue. Holds the serviceTime for each customer.
Functionality:
Constructor: Random ServiceTime (1-5)
Public Methods: getServiceTime, newMinute
*/
import java.util.Random;
public class PriorityCustomer {
private int serviceTime; // ServiceTime for this Customer
private int priority; // Priority for this Customer
/// Constructor
public PriorityCustomer() {
serviceTime = new Random().nextInt(5) + 1; // Randomly assign required service time 1-5
priority = new Random().nextInt(5) + 1; // Randomly assign priority 1-5
}
public int getPriority(){
return priority;
}
/// Getter for ServiceTime
public int getServiceTime() {
return serviceTime;
}
/// Decrement ServiceTime by 1
public void decServiceTime() {
serviceTime--;
}
}