Question: Write a multithreaded program that mimics a taxi service ( Java Limousines ) which has 5 drivers. Customer information is read in from a text

Write a multithreaded program that mimics a taxi service (Java Limousines) which has 5 drivers. Customer information is read in from a text file attached (Delimiter is yes). The dispatcher program should read the file and load the customer info into a queue. On duty Driver threads should keep picking up customers from the queue. They can serve a maximum of 4 customers before going offDuty. Use sleep to mimic time taken to drop each customer. Find attached the customerlist and Customer.java. Create Dispatcher.java and Driver.java to mimic the dispatcher and drivers. You can add/modify classes as needed.You may use locking mechanisms discussed in class like synchronized keyword, relevant methods of java.lang.Object (i.e. wait(),notify(), and notifyAll()),locks, concurrent coollections etc. Hint try using blocking queues

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!