Question
1. Create a class hierarchy which has an abstract class called WordList (the same class as in project 2 but it is abstract). This class
1. Create a class hierarchy which has an abstract class called WordList (the same class as in project 2 but it is abstract). This class should have two subclasses: UnsortedWordList and SortedWordList, each having a method called add. In the UnsortedWordList the method add will add to the end of the list (append), and in the SortedWordList it will do an insert. So now, rather than in project 2 where you used two of the same kind of list (WordList) you will use one unsorted list and one sorted list.
2. Create a new exception called IllegalWordException by extending lllegalArgumentException. 3. When you create a new Word from a String read from the input file, catch any exceptions thrown by the constructor and print the offending string to the console along with the message from the Exception. The constructor should check that the word is
3 characters, and all the characters are letters. 4. Add a File menu to your GUI which has menu items for Open and Quit. You should now be able to select an input file using the GUI.
The input file : (Word.txt)
words.txt
cat
rat
sat
the,cat,is,red
my,dog,is,not,blue
the
quick,brown,fox jumps,over,the,lazy,dogs
You should now have at least the following files to submit for this project:
Project3.java
Word.java
WordGUI.java
WordNode.java
WordList.java
UnsortedWordList.java
SortedWordList.java
FileMenuHandler.java
IllegalWordException.java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started