Question: In Java: Use an Array Bag and Threading to complete this assignment Objective: - Use fundamental data structures such as stacks, queues, linked - lists,
In Java:
Use an Array Bag and Threading to complete this assignment Objective:
Use fundamental data structures such as stacks, queues, linkedlists, and trees to represent data and meet application requirements.
Demonstrate knowledge of recursion by describing common applications and by effectively using it to solve problems.
Use of appropriate algorithms to solve common computing problems.
Problem:
Write a simulation program of cashier lines at a grocery store. Assume that this store has five cashier lines. Customers enter randomly to check out, and then enter the shortest line. If the lines are equal, then the first available line is chosen. Each transaction takes a random amount of time to complete. The customer can:
avoid a line if all lines are a certain length
leave a line if they have waited beyond a certain time
check if another line is shorter at specified time intervals
switch lines if another line is shorter
Note:
Use an ArrayBag to implement the queue
Do NOT use any Javabuilt in data structures eg ArrayList, List, Queue, etc
Submit your program as a complete, standalone, runnable program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
