Description
COM2067/COM267 LAB5
Input Output
122 1 2
128 1 1
113 1 2
118 2 3
119 2 5
115 2 9
127 3 1
156 3 4
112 3 5
121 3 7
-1 122 6 1 3 0
128 5 1 2 0
113 4 1 3 0
118 5 2 5 0
119 3 2 7 0
115 2 2 11 0
127 6 3 4 0
156 4 3 7 0
112 1 3 8 0
121 6 4 11 1
6 10
5 4
4 6
3 5
2 9
1 5
In the given input, the first customer with the account number 122 comes to the bank in the 1st minute and has 2 minutes processing. (You can think of “comes in the first minute” as coming at the beginning of the first minute). Write a C program that process the transactions (given in the text file), that took place from the beginning of the 1st minute until the time when no customers are left in the bank. The output will consist of customer number, employee number, time the transaction started, time the transaction finished, customer waiting time in queue. Additionally each employee’s total serving time will be printed.
If you examine the output, you can see that the customer with account number 122 arrives in the 1st minute, the transaction is completed at the beginning of 3rd minute (because of the 2-minute process) and does not wait at all in the queue. Since this is the first customer to arrive, the bank employee at the top of the stack, namely the bank employee with identification number 6, took care of him. The second customer was taken care of the bank employee with identification number 5 (the topmost member of the stack after 6). The bank employee, whose job is finished, settles on the top of the back pile. Write and use all the necessary methods of “Stack” and “Queue” structures in your program. You can implement stacks and queues using either array or link list.




Reviews
There are no reviews yet.