官术网_书友最值得收藏!

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:

  1. 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.
  2. 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.
  3. 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.

主站蜘蛛池模板: 伽师县| 滁州市| 阳东县| 乡城县| 彰化市| 延边| 乌鲁木齐县| 科技| 修水县| 台北县| 江华| 鞍山市| 永嘉县| 肥城市| 徐汇区| 灵山县| 于田县| 丹江口市| 肃北| 喀喇沁旗| 林芝县| 贵港市| 永胜县| 黄梅县| 林甸县| 丹阳市| 噶尔县| 科技| 宁乡县| 南投县| 鹤壁市| 武隆县| 中卫市| 门源| 蓬安县| 兴山县| 永安市| 政和县| 通城县| 讷河市| 宣化县|