-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueueTest.java
More file actions
26 lines (23 loc) · 779 Bytes
/
QueueTest.java
File metadata and controls
26 lines (23 loc) · 779 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
/**
Author: Rajin Santos Gajadhar
Student ID: 239479650
Lab 8
Any and all work in this file is my own.
*/
public class QueueTest {
public static void main(String[] args) {
Queuelab queue = new Queuelab();
try {
String[] names = {"Rajin", "Margaret", "Nicole", "Michelle", "Diana", "Keira", "Tiana", "Zarina", "Hannah", "Ian"};
for (String name : names) {
queue.enqueue(name);
System.out.println("Enqueue: " + name + " | Queue: " + queue);
}
while (!queue.isEmpty()) {
System.out.println("Dequeue: " + queue.dequeue() + " | Queue: " + queue);
}
} catch (QueueException e) {
System.out.println(e.getMessage());
}
}
}