List of Words Create a class called WordNode which has fields for the data (a Word)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
List of Words Create a class called WordNode which has fields for the data (a Word) and next (WordNode) instance variables. Include a one-argument constructor which takes a Word as a parameter. (For hints, see the PowerPoint on "Static vs. Dynamic Structures".) public WordNode (Word w) { . . } The instance variables should have protected access. There will not be any get and set methods for the two instance variables. Create an abstract linked list class called WordList. This should be a linked list with head node as described in lecture. Modify it so that the data type in the nodes is Word. The no-argument constructor should create an empty list with first and last pointing to an empty head node, and length equal to zero. Include an append method in this class. Create two more linked list classes that extend the abstract class WordList: One called UnsortedWordList and one called SortedWordList, each with appropriate no-argument constructors. Each of these classes should have a method called add(Word) that will add a new node to the list. In the case of the UnsortedWordList it will add it to the end of the list by calling the append method in the super class. In the case of the SortedWordList it will insert the node in the proper position to keep the list sorted. Instantiate two linked lists, and for every Word read from the file, add it to the unsorted and sorted lists using the add method. You will end up with the first list having the Words from the input file in the order they were read, and in the second list the Words will be in sorted order. Display the unsorted and sorted Words in the GUI just as in project 1. Submitting the Project. You should now have the following files to submit for this project: Project2.java Word.java WordGUI.java WordNode.java WordList.java UnsortedWordList.java SortedWordList.java List of Words Create a class called WordNode which has fields for the data (a Word) and next (WordNode) instance variables. Include a one-argument constructor which takes a Word as a parameter. (For hints, see the PowerPoint on "Static vs. Dynamic Structures".) public WordNode (Word w) { . . } The instance variables should have protected access. There will not be any get and set methods for the two instance variables. Create an abstract linked list class called WordList. This should be a linked list with head node as described in lecture. Modify it so that the data type in the nodes is Word. The no-argument constructor should create an empty list with first and last pointing to an empty head node, and length equal to zero. Include an append method in this class. Create two more linked list classes that extend the abstract class WordList: One called UnsortedWordList and one called SortedWordList, each with appropriate no-argument constructors. Each of these classes should have a method called add(Word) that will add a new node to the list. In the case of the UnsortedWordList it will add it to the end of the list by calling the append method in the super class. In the case of the SortedWordList it will insert the node in the proper position to keep the list sorted. Instantiate two linked lists, and for every Word read from the file, add it to the unsorted and sorted lists using the add method. You will end up with the first list having the Words from the input file in the order they were read, and in the second list the Words will be in sorted order. Display the unsorted and sorted Words in the GUI just as in project 1. Submitting the Project. You should now have the following files to submit for this project: Project2.java Word.java WordGUI.java WordNode.java WordList.java UnsortedWordList.java SortedWordList.java List of Words Create a class called WordNode which has fields for the data (a Word) and next (WordNode) instance variables. Include a one-argument constructor which takes a Word as a parameter. (For hints, see the PowerPoint on "Static vs. Dynamic Structures".) public WordNode (Word w) { . . } The instance variables should have protected access. There will not be any get and set methods for the two instance variables. Create an abstract linked list class called WordList. This should be a linked list with head node as described in lecture. Modify it so that the data type in the nodes is Word. The no-argument constructor should create an empty list with first and last pointing to an empty head node, and length equal to zero. Include an append method in this class. Create two more linked list classes that extend the abstract class WordList: One called UnsortedWordList and one called SortedWordList, each with appropriate no-argument constructors. Each of these classes should have a method called add(Word) that will add a new node to the list. In the case of the UnsortedWordList it will add it to the end of the list by calling the append method in the super class. In the case of the SortedWordList it will insert the node in the proper position to keep the list sorted. Instantiate two linked lists, and for every Word read from the file, add it to the unsorted and sorted lists using the add method. You will end up with the first list having the Words from the input file in the order they were read, and in the second list the Words will be in sorted order. Display the unsorted and sorted Words in the GUI just as in project 1. Submitting the Project. You should now have the following files to submit for this project: Project2.java Word.java WordGUI.java WordNode.java WordList.java UnsortedWordList.java SortedWordList.java
Expert Answer:
Answer rating: 100% (QA)
Below is the implementation of the requested classes java Wordjava public class Word private String word public WordString word thisword word public S... View the full answer
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these programming questions
-
List the Words once and the line numbers on which they appear The content pane of the GUI should still have a grid layout of one row and two columns. When the user clicks on List a choice can be made...
-
Consider the following scenario. Each day, a butcher buys a 200-kilogram pig for $360. The pig can be processed to yield the following three products: Day 1 The butcher buys a pig. The $360 joint...
-
A sports car accelerates from rest to 95 km / h in 4.3 s. What is its average acceleration in m / s2?
-
Glorietta Trust is an irrevocable discretionary trust funded by Grant Glorietta. The discretionary income beneficiary for life is Grant's son, Gordon Glorietta (single). Gordon is a partner in a...
-
Outline the general strategy used in metagenomics.
-
Yong Companys income statement for the year ended December 31, 2014, and its comparative balance sheets as of December 31, 2014 and 2013, follow. During 2014, the company engaged in these...
-
3. You have been provided with the information listed below for the City of XYZ. 2024 2025 market value of taxable property $1.3 billion increases by 2.0% from 2024 exemptions $26 million increases...
-
Overview The milestone for Project One involves applying accounting principles and methods to long-term liabilities and equity. You will also evaluate these financial statement components for...
-
Explain 5 different criteria of Embedded systems and the Internet of Things (IoT). Find 2 examples of Embedded systems and explain in detail the technical parts that make them become Embedded systems.
-
You are in charge of planning a new investment for your firm that will cost $850,000 today. The investment is expected to produce a cash flow of $450,000 in year one. Each of the following years the...
-
Use the Zero Property Rule to find the solution (s). x^(2)+9x+14=0
-
discuss the complexities of hormone feedback regulation and feedback loops within the endocrine system, including short-loop, long-loop, and ultrashort-loop feedback mechanisms, and how dysregulation...
-
Stacey Kessler has the following current-year passive income and loss amounts: $10,000 ABC ($18,000) XYZ What is the net income reported this year for the private interest activity if XYZ was...
-
Describe a counter measure that will address the impact and like hood of financial risk?
-
A Treasurer buys a 6-month CD issued by a top-class bank with a tenor of 180 days at a yield of 16%. The face value at issue is GHe10m. In 90-days time the buyer sells the CD when the 3-month...
-
Does log 81 (2401) = log 3 (7)? Verify the claim algebraically.
-
A long-distance provider charges the following rates for telephone calls: Create a GUI application that allows the user to select a rate category (from a set of radio buttons), and enter the number...
-
A class that implements this interface can handle mouse dragged events. a. MouseListener b. ActionListener c. MouseMotionListener d. MouseDragListener
-
What do you do to a group of radio button menu items so that only one of them can be selected at a time?
-
Suppose you want to create a price index for the price of a personal pizza across several Canadian university campuses, as of March 1 , 201 6. The data are as follows: a. Using Calgary as the "base...
-
Fill in the blanks to make the following statements correct. a. Ceteris paribus, the price of a product and the quantity demanded are related ________ b. Ceteris paribus, the price of a product and...
-
The following questions will provide practice working with simple linear functions. All questions refer to a coordinate graph with the variable \(X\) on the horizontal axis and the variable \(Y\) on...
Study smarter with the SolutionInn App