A Queue Simulation

Let's apply our improved understanding of classes to a programming problem. The Bank of Heather wants to open an automatic teller in the Food Heap supermarket. The Food Heap management is concerned about lines at the automatic teller interfering with traffic flow in the market and may want to impose a limit on the number of people allowed to line up at the teller machine. The Bank of Heather people want estimates of how long customers will have to wait in line. Your task is to prepare a program to simulate the situation so that management can see what the effect of the automatic teller might be.

A rather natural way of representing the problem is to use a queue of customers. A queue is an abstract data type (ADT) that holds ...

Get The Waite Group's C++ Primer Plus, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.