- Modular Programming with Python
- Erik Westra
- 390字
- 2021-07-16 10:47:18
The inventory control system
Imagine that you have been asked to write a program that allows the user to keep track of the company's inventory—that is, the various items the company has available for sale. For each inventory item, you have been asked to keep track of the product code and the item's current location. New items will be added as they are received, and existing items will be removed once they have been sold. Your program will also need to generate two types of reports: a report listing the company's current inventory, including how many of each type of item there are in each location, and a report that is used to re-order inventory items once they have been sold.
Looking at these requirements, it is clear that there are three different types of information that we will need to store:
- A list of the different types of products that the company has for sale. For each product type, we will need to know the product code (sometimes called an SKU number), a description, and the desired number of items that the company should have in its inventory for that type of product.
- A list of the locations where inventory items can be held. These locations might be individual shops, warehouses, or storerooms. Alternatively, a location might identify a particular shelf or aisle within a shop. For each location, we need to have a location code and a description identifying that location.
- Finally, a list of the inventory items that the company currently holds. Each inventory item has a product code and a location code; these identify the type of product and where the item is currently held.
When running the program, the end user should be able to perform the following actions:
- Add a new item to the inventory
- Remove an item from the inventory
- Generate a report of the current inventory items
- Generate a report of the inventory items that need to be re-ordered
- Quit the program
While this program is not too complicated, there are enough features here to benefit from a modular design, while still keeping our discussion relatively brief. Now that we have taken a look at what our program needs to do and the information we need to store, let's start applying modular programming techniques to the design of our system.
- 國際大學生程序設計競賽中山大學內部選拔真題解(二)
- 深入淺出Electron:原理、工程與實踐
- WebAssembly實戰
- Vue.js 2 and Bootstrap 4 Web Development
- Vue.js 3.x從入門到精通(視頻教學版)
- Visual C++數字圖像模式識別技術詳解
- Rake Task Management Essentials
- ASP.NET動態網頁設計教程(第三版)
- 從零開始學C語言
- 時空數據建模及其應用
- Mastering Docker
- Python Machine Learning Blueprints:Intuitive data projects you can relate to
- Python函數式編程(第2版)
- Visual Basic語言程序設計基礎(第3版)
- 少兒編程輕松學(全2冊)