- 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.
- Java應用與實戰
- 數據庫系統教程(第2版)
- Hands-On Data Structures and Algorithms with JavaScript
- Raspberry Pi for Secret Agents(Third Edition)
- OpenNI Cookbook
- C# 8.0核心技術指南(原書第8版)
- C語言程序設計
- Mastering ROS for Robotics Programming
- C語言開發基礎教程(Dev-C++)(第2版)
- Spring Boot+MVC實戰指南
- Java EE Web應用開發基礎
- Scala Functional Programming Patterns
- Socket.IO Cookbook
- Python Django Web從入門到項目實戰(視頻版)
- jQuery Essentials