 CSE 109 Programming Assignment #3   Due: 9 PM Thursday 19 March 2009
 [Late collections 9 PM  Saturday 21 March, Sunday 22 March]

 This assignment is an exercise in creating a templated class.  I ask you to
 to create the templated class Table, which implements the ADT for a lookup
 table, which stores information corresponding to various keys.  You look
 up a given key, if it is in the table, and retrieve the information stored
 with that key.

 I have stored a program for testing your templated class Table in
 /csc109/proj/p3/testP3.cc  Copy this file into your directory
 cse109.091/p3, renaming testP3.cc p3.cc.

 Create a Makefile for compiling p3.  DO NOT CHANGE THE CODE OF p3.cc AT
 ALL. I REPEAT, DO NOT CHANGE THE PROGRAM CODE IN ANY WAY OTHER THAN TO ADD
 DOCUMENTATION (name, assignment, program purpose, etc.,) ELSE LOSE AT LEAST
 20 PTS. I will test your class Table< , > by using the command "make clean"
 to discard all .o files (where you should implement "clean" in your Makefile),
 by replacing your p3.cc with the the file /proj/csc109/p3/testP3.cc,
 by using your Makefile to compile p3.cc, and then by  running the resulting
 executable file p3. IT IS IMPORTANT THAT YOU COMPILE ALL YOUR .cc FILES
 WITH THE -Werror  -Wall OPTIONS (E.G., g++ -c -Werror -Wall p3.cc).
 NOTE THAT I MAY WELL USE OTHER PROGRAMS TO TEST YOUR TEMPLATE.

 When you are ready to submit your work, create the file "DONE" by executing
 the command "touch DONE".

 Notes: 0. You are free to choose your own implementation of the lookup
         table, BUT IT IS IMPORTANT THAT YOU WRITE YOUR OWN CODE, except that
         you are free to use any code that I have presented in class. YOU ARE
         NOT ALLOWED TO USE SOME RELEVANT CODE FROM THE BOOK, CODE FROM A
         FRIEND, OR CODE FOUND ON LINE.  Because your code will be quite
         different from that of other students, the next point is very
         important. Good docuementation is necessary for me to read your code.
         You could extend the ideas in class RAY to implement the table, you
         could extend the ideas in class (binary or ternary) Tree, etc.
        1. All your files should have good documentation.  Each file should
         have identifying information at the top, e.g., your name, the course,
         the assignment number.  Your templated class should be documented
         with comments at the top which explain the class and its purpose.
         The role of each data member should be explained.  Each member
         function should be explained (e.g., by stating pre- and
         post-conditions and by stating the overall algorithm).  Hard
         to understand sections of code should be explained.
        2. The directory /proj/csc109/p3 contains the files testP3.cc.
        3. The class Table should implement the following methods, among
         others (I use parentheses to indicate the function but not the
         parameterization).
                inTable()   return whether a given key is in the table
                add()       add a key and the corresponding data to the
                            table, unless the key is already there, in
                            which case crash
                []()        give access to the data corresponding to the
                            given key BUT, UNLIKE OUR TREE EXAMPLE, CRASH
                            IF THE KEY IS NOT IN THE TABLE.
                clear()     remove all the entries in the table
        4. The entries in the table can be stored in any order.
        5. I have included sample output at the end of the file testP3.cc.
           Your results may vary slightly.

IN THE SYLLABUS READ THE STATEMENT ABOUT UNFAIR COLLABORATION AND AVOID
UNFAIR COLLABORATION
