CSE 109 Programming Assignment #3 Due: 9 PM Sunday 16 March [Late collections 9 PM Monday 17 March, Tuesday 18 March] This assignment is an exercise in templating a class. I ask you to write a template for your class HashTable, your implementation of the hash table in p2.cc. Your new class should be parameterized for various types of keys and types of data. Thus, e.g., class HashTable might be used in place of your class HashTable from programming assignment #2. In addition to the methods you developed for assignment #2, your templated class should implement the methods below for iterating over the entries in the table (where the actual order of iteration through the table is irrelevant, so long as you visit all elements in the table): iteratorReset() sets the iterator to the "first" entry in the table iteratorAtEnd() returns false if and only if there is another item to return nextKey() returns the key from the "current" link in the table and moves on to the next link I have stored one (of a number of?) test programs for your templated class in /csc109/proj/p3/testTemplate.cc. Copy this file into your directory cse109.081/p3, renaming testTemplate.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 templated class 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/testTemplate.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: 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. It is fairly easy to convert your code for Link from p2 to a (single file with a) templated class for Link, and it is fairly easy to convert your code for HashTable to a (single file with a) templated class for HashTable. Get that running before you go on to add the methods for iteration. 3. The order in which you iterate over the table is unimportant. You simply must visit each node exactly once during one complete iteration. 4. Your solution to p3 depends on your having a running solution to p2. If you failed to get p2 running, I don't want to punish you twice. The files for my solution to p2 are stored in /proj/csc109/p3/link.h, /proj/csc109/p3/link.cc, /proj/csc109/p3/hashTable.h, and /proj/csc109/p3/hashTable.cc. Note that my documentation in link.h and hashTable.h is too terse. Your documentation should be more detailed and more complete. 5. Remember well that you should have all the templated information in link.h and hashtable.h. You should not have a link.cc nor a hashtable.cc file, because there is nothing to compile. 6. For the previous program, p2, the class HashTable depended upon a wrapper class for ints, Hash. For this program, your HashTable should assume that instead of having a wrapper class available for keys the keys should be instances of some class that has the instance method hash(), which returns the hash number corresponding to the given key. IN THE SYLLABUS READ THE STATEMENT ABOUT UNFAIR COLLABORATION AND AVOID UNFAIR COLLABORATION