(Latest Revision -- 04/06/00)
04/06/00: Added warning about form and testing
03/31/00: Added an item regarding clearing buffers
03/30/00: Added detail to discussion of list-numbering

List Of Gotcha's On The Match Program

  1. You need to put #include<fstream.h> in the program in order to use objects of type ifstream and ofstream (input and output files).

  2. You must pass a stream as a reference parameter.

  3. An array (e.g. an array of lists) is passed by reference automatically. (The name of an array is equivalent to a const pointer to the base of the first array slot.)

  4. HOWEVER individual objects of one of the list classes will NOT be passed by reference automatically so it is necessary to use the &.

  5. Unlike the indexing of C++ arrays, the list elements are numbered from 1 up to the size (length). There is no 0-th element of a list, and there is a size-th element.

    Example: If the list contains 10 elements, they are in positions 1 through 10.

    Example: You will want to have some for-loops that look like this:
    for (i=1; i<=numberWomen; i++)
    rather than like this:
    for (i=0; i<numberWomen; i++)
    Be careful, it is easy to forget to change one or both of the upper or lower index limits of the loop.

  6. There has to be some way to look at the client record and determine if the record is matched or not. For example, use some special value like -1 in the matched position field to denote that there is no current match.

  7. Your program should close streams (files) after it finishes using them. If not, it may have problems opening other files.

  8. Be careful to clear "buffers" appropriately before loading the next set of data. For example, in the following code segment taken from "buildLists:"
    
    for (clientNum=0; clientNum<numClients; clientNum++)
    {
      getNextClient(item, gender, clientFile) ;
      putClientInList(item, gender, clientD) ;
    }
    
    The function "getNextClient" has to somehow make sure that when it puts new information into "item" that no old information remains from the previous client record. This is particularly apt to occur in the list of interests if not handled correctly.

  9. Remember to indent your code properly, put a header comment at the beginning of each function, and turn in a test script showing adequate testing. I will take off 20 percentage points for each one of these things, if you neglect it completely.