This assignment asks you to build a dictionary that, given a word, can find its meaning. It should consist of three classes:
- Definition: This class should contain both a word and its meaning. Both should be initialized upon construction and accessible thereafter. Since the meaning of a word can evolve over time, the meaning should be changeable after initialization. Additionally, Definitions should be Comparable, this means implement the Comparable interface and have the compareTo method, so that they can be alphabetized.
- Dictionary: This class should contain a collection of Definitions, implemented as an array of Definitions. It should be constructed empty with a maximum capcity as specified by the user. Users should be able to add() Definitions, in which should be kept in alphabetical order, in order to facilitate searching for Definitions. It should be possible to, given a word, find its meaning (Hint: Create an empty Definition and search for it). It should also be possible to print (yes, I/O) each and every Definition within the Dictionary. This class should also include a reasonable toString();
This class should include and make reasonable use of the DictionaryFullException and WordNotFoundException.
- DictionaryProgram: This class should contain a main() method that provides the user with a menu. The menu should allow the user to create a new Dictionary of any size, add() words to the dictionary, and to find() and print a Definition, given a word. Additionally, the user should be able to print an alphabetized list of all words. And, of course, the user should be able to exit the program. In the event of an error, a reasonable error message should be displayed.
Searching should be via a binary search.