For this assignment, you design and implement a telephone directory program using a hash table.
The telephone directory program allows the user to enter one of several choices, including:
How you implement this user interface is up to you.
Your hash table should use the String.hashCode method to compute the hash for a given name.
When inserting a new name and phone number, a record with the same hash code might already be in the array. This might mean one of two things:
Whenever you increase your array size, you must re-hash all the elements from the old array into the new array. Your initial table size should be 3, and the first time it grows it should have size 7, then 15, 31, 63, etc. You should test your code with at least 10 entries.
The hash table does not ever need to become smaller.
The detailed structure (classes, methods, user interface) of your code is up to you, but you may lose points if you choose a particularly poor design. For example, putting all of your code in a single main method would be very poor design. On the other hand, the type of code structure used in prior assignments is likely to be quite good. If needed, the TA or the instructor can give you feedback on your design.
After you finish the assignment and if you wish to challenge yourself, here are some suggestions. None of these carry extra credit, so make sure you have implemented the assignment before you spend any time on the options.
Turn in your entire version of all the code so that your program executes correctly.
Email your assignment to the TA following the instructions here.