Supermarket Checkout Lines Simulation, c++ This problem requires you to develop a c++ program that processes incoming
Question:
Supermarket Checkout Lines Simulation, c++ This problem requires you to develop a c++ program that processes incoming customers at your favorite supermarket’s checkout counters. The goal of the program is to help a supermarket manager determine how many checkout lanes to open. Specifically, your simulation should behave as follows: a. There are K checkout counters available where K = {1,2,..20}. Each of these checkout counters is modeled as a queue of customers. b. Your program will read a file (e.g. “arrivals.txt”) and process each customer and the associated time required to process the customer. You do not have to sort the arrival times, they will be in the file from smallest to largest. c. Customers always enter the back of the queue with the fewest customers. Once they enter a queue, they cannot jump to another queue. To complete this project, you are required to implement the queue Abstract Data Type using a singly linked list. To help you, I have provided a nearly complete templated Queue and Node class in QueueStart.zip. You will need to add a private current Size data member (and public getter method) to the queue class and use it to keep track of the number of objects in the queue at all times. To complete this assignment, you will need to define an array of K such queues (i.e., there is one queue for each checkout counter). For this project, the event that drives your simulation is the elapsing of each minute of the clock. Your simulation is for a grocery store that is open for 10 hours. Begin at minute 1 and allow customers to enter the checkout lanes until minute 600. Do not allow any new customers to arrive at the checkout counter after minute 600, but continue the simulation until all customers have been processed. At each clock tick, you’ll need to do the following:
1) Every time a new customer arrives at the checkout area, they must be added to the shortest queue. Your program must therefore determine which queue contains the fewest customers, and then invoke that queue’s enqueue method to enqueue the new customer.
2) After newly arriving customers have been queued, dequeue any customers who have finished the checkout process.
3) Work on processing customers at the head of each line. Every hour, and after the last customer is processed, your program should print how long each queue currently is. The final display messages should indicate the total number of customers processed, the average time it took customers to be processed by a clerk, the average time customers waited in line (this includes the processing time), and the longest time that any customer had to wait in line. Run your program several times using the given input file, arrivals.txt, to determine the minimum number of checkout counters (K) needed to keep the average checkout time for each customer below a reasonable number of minutes. Report your findings in a comment in your main file. Also test your program on other input files, such as arrivals10000.txt. As part of the header comment in your file with your main function, be sure to include the compilation command, for example: g++ -std=c++11 shoppingMain.cpp Customer.cpp. You do not need to use these filenames for your solution. Your executable must take 2 arguments, the filename and K, the number of checkout lanes. For example, this command will read the file “arrivals.txt” and process it using 5 checkout lanes: ./a. out arrivals.txt 5 If you encounter strange behavior reading the text file, be sure that your ftp software didn’t introduce an unexpected format, like Unicode-8 (this was a problem in the past with the settings in WinSCP).
Auditing and Assurance services an integrated approach
ISBN: 978-0134065823
16th edition
Authors: Alvin A. Arens, Randal J. Elder, Mark S. Beasley, Chris E. Hogan