Homework 3 Frequently Asked Questions

  1. Is there a max length on the product code?
    No.
  2. Is there a max price for a particular item?
    No.
  3. Is there a maximum on how many of something someone can order?
    No.
  4. Who specifies the name of the order file - the user or us ... if the user, is it on the command line or when they start a new order?
    You do. (ie, the programmer)
  5. Does adding and removing a product code have to be case insensitive?
    Yes, it should be case insensitive, as should searching for a product.
  6. Does the user tell us which method of searching he's using?
    No. The user will simply select "Search" from your menu, and enter the query string. You must then parse the query string to figure out which method the user is using.
    1. Should the search query look for parts of words to match, or just whole words?
      Whole words. For example, in the sample inventory, if I do a search for the word "Eye" (without the quotes), I should not get back the title containing the word "Eyeballing". I should only get back the two titles containing the actual word "Eye" (case insensitive, of course).
    2. What about for phrase searches?
      This is the exception to the above rule. A search for a phrase (ie, a search in quotes) may search for its sequence of characters anywhere in the title, without regard to word boundaries. So if the user searches for "Eye" with the quotes, the title "Eyeballing the Internet" should be returned.
  7. Do we have to worry about formatting of the prices (ie, make sure $30.50 isn't printed out as $30.5)?
    No. You need not concern yourself with this. However, if you would like to do this to make your output look better, Perl does have the same printf and sprintf functions that you may be used to seeing in C. The camel can show you how to use them.
  8. What should the output of the order file look like?
    That's up to you. The only requirement is that it be human-readable. A human looking at the file must be able to quickly see each piece of information (product code, title, unit price, quantity, product subtotal, grand total) without having to decipher your format.