Provide a methodology, design, Java Implementation and results (do not include packages or jar files in your final submission) for this assignment (see Problem below). Submit your assignment in a ZIP file to WebCT, with clearly defined parts. The submission will include Word or Text files and the java source and class files. Each deliverable must be clearly labeled, including your name and course title. See the Deliverables section for details.
A barbershop has a cutting room with one chair and a waiting room with five chairs. A limitless number of customers enter the waiting room one at a time if space is available otherwise they go to another shop. Each time the barber finishes a haircut, the customer must pay at the cash register only one customer may pay at a time, addition customers waiting to pay must wait, if the cashier is asleep, the paying customer must wake the cashier up, after paying the customer leaves to go to another store, if the cashier has no waiting customers, the cashier falls asleep. A waiting customer, if there is one, enters the cutting room and has a haircut. Customers may enter the waiting room one at a time, or waiting customer may enter the (empty) cutting room one at a time, but these events are mutually exclusive. If the barber discovers that the waiting room is empty, the barber falls asleep in the waiting room. An arriving customer, finding the barber asleep, wakes the barber and has a haircut otherwise the arriving customer waits. Use must use java semaphores/monitors to coordinate the operation of the barber, clients and the cash register.
ï¿½ The time cutting is random between 1 and 3 seconds
ï¿½ The simulation must run for at least 2 minutes.
ï¿½ Customers enter the store randomly between 1 and 3 seconds
ï¿½ Cash register takes between 1 and 3 seconds cashing out a customer.
ï¿½ Seconds are in whole numbers. (1,2 or 3)
Notes: Your simulation must show the following console output
ï¿½ Status of the barber, clients and cashier when any changes occur.
ï¿½ Number of customers at all points, at all times.
ï¿½ When the barber is asleep.
ï¿½ When the cashier is asleep.
ï¿½ When the chairs are full.
ï¿½ The number of customers waiting to pay
The finished project will include the following
ï¿½ A single file containing design specification for this project
ï¿½ Any additional Java Source code.
ï¿½ The executables (class files)
ï¿½ Any other source files necessary to build your system.
ï¿½ A detailed README file describing the use of the system.
ï¿½ Design Documentation that includes at least (1) state and (2) flow diagrams, description of all (3) classes and (4) methods, all attributes passed to the (5) methods and (6) classes, (7) methodology, (8) problem definition.