Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 15. Case Study 2—An Inventory Table > 15.8 AMENDING THE INSTOCK VALUE

15.8 AMENDING THE INSTOCK VALUE

When an item is sold, or when new stock is received from a supplier, its instock value must be updated. The process searches for the item and, if found, simply prompts for the updated value, storing it as the new instock quantity. A more time-consuming version might have the user enter the quantity of an item and specify whether it is being sold or restocked, updating instock accordingly.

pseudocode for quantity update…
read in code value sought
apply the hash function to obtain the location
if not found
    write out 'Item not present'
else
    write out code, name, instock value
    prompt for new quantity and read it in
    set instock to new value
endif


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial