5.1 What We Are Simulating
This chapter simulates how a supermarket keeps a check on its stock and when to order replacement stock from suppliers.
We create a file for the stock of different types of cheese that the supermarket sells. Each time a block of cheese goes through the checkout, a message is sent to the monitoring program which checks if a reorder is needed. If so, it outputs a message to say the type of cheese needed and the address where you need to send the order to. If a new supply is received by the supermarket, then the monitoring program is told this and the file is updated appropriately. ...