A barber shop has one or more barbers who service customers as they arrive on a first-come-first-serve basis. Depending on the type of haircut a customer desires the service time varies. A barber shop also has a limited number of chairs for waiting customers. If all the chairs are filled, an arriving customer leaves without entering. For this assignment you will simulate a barber shop with customers arriving at various times each requiring a variety of service times. We are interested in observing the behavior of the barber shop at intervals of time. To simulate customers arriving at you will use a queue and to simulate customers waiting in a barber shop you will use a circular queue where the size is equal to the number of chairs available.
Your program will read a text file that contains a customer’s arrival time, his service time (i.e., the time the barber requires to give this customer the haircut he desires,) and his name. Below is a sample input file.
At each time interval report the customer that is arriving, the customer that is being serviced by the barber, and customers waiting in chairs. If the barber shop is full (i.e., all the chairs are filled) an arriving customer leaves without a haircut. (See the sample output file BarberShopOutput.docx. For the sample, the barber shop has 3 chairs available.) Your program needs to accommodate a variable number of chairs.