Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java Program that: Create three classes for the words: An abstract class called Word, a class called Noun that inherits from Word, and

Write a Java Program that:

Create three classes for the words: An abstract class called Word, a class called Noun that inherits from Word, and a class called Verb that inherits from Word. The actual word is stored in class Word. The classes Noun and Verb should have different toString methods the return the word with either (N) or (V) appended.

Create three classes for the linked list: An abstract class called WordList (as in project 2) which contains all the functionality of the linked list, and classes called UnsortedWordList and SortedWordList which inherit from WordList. Each of these two classes should have an insert method that adds a new word in the appropriate position in the list.

The GUI should now have two TextAreas: the one on left showing the contents of the unsorted list, and the one on the right showing the contents of the sorted list. The command window (ADD, DELETE, STOP) should function as in project 2.

Create two menus for the GUI: One called File (with choices Open and Quit), and one called Display (with choices Nouns and Verbs).

File > Open: open the selected file, fill the linked lists and display them in the text areas. File > Quit: exit the program. Display > Nouns: clear the text areas and then display only the nouns on the lists. Display > Verbs: clear the text areas and then display on the verbs on the list.

The input file will be in the following format: one word per line followed by either N or V in parenthesis: apple(N)

peach(N) eat(V)

Continuing the theme of project 3, adjust the program so that the left text area displays the words using a Hashmap (the order of the words will be unpredictable), and the right text area displays the words using a TreeMap (the words should be in sorted order).

If you did not get project 3 to work entirely, you are not responsible for the menus and menu items for the project, or for adding additional words, or for displaying only nouns or verbs. For project 4 you are only responsible for displaying the original input file in the two text areas as described above.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago