© Philip Joyce 2020
P. JoycePractical Numerical C Programminghttps://doi.org/10.1007/978-1-4842-6128-6_5

5. Supermarket Stock

Philip Joyce1 
(1)
Goostrey, UK
 

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. ...

Get Practical Numerical C Programming: Finance, Engineering, and Physics Applications 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.