Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help me understand and walk through this task. using java please thanks App class is package main; public class App { public void run() {

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedhelp me understand and walk through this task. using java please thanks

App class is

package main; public class App { public void run() { // TODO: code this run so that it works as shown in the example // output in the instructions - and so that all the tests in MainTests pass as well } private void displayInstructions() { System.out.println("Hi! I'm the Two-Ended List app!"); System.out.println( "Every word you enter on a line will be added to me in alternating head/tail order."); System.out.println("I will turn each word to lowercase before it is added."); System.out.println(); System.out.println("I will show you my contents after every word."); System.out.println("I will stop when you enter an empty line."); System.out.println("Ready? Start entering words!"); }

The main class is :

package main; public class Main { public static void main(String[] args) { App app = new App(); app.run(); } }

introduction:

You're going to be making a TwoEndedSll class, representing a singly-linked list that has some specific properties. Here are the details: it will be generic...so you can toss whatever reference type you want in it. you can both add and remove from this list - but only at its head or tail - no adding/removing middle bits! (this is a blessing, of course) if you attempt to remove from an empty list, it'll throw a NoSuchElementException. even though we can add/remove from either end of this list, when we get its contents, they are always in order from head to tail. you should make your Node class a static member class. What does that mean? It should be located inside your TwoEndedSll class and declared as private static Node. Of course, I realize I can't force you to do so. But still...practice good practice, folks! Of the three drills in this checkpoint, this will easily take the longest to complete. But there's an upside: the list you create in this drill makes the other two drills a snap, so the time you spend here will pay off.

Create a TwoEndedSll class in the main package. This class represents a list that you modify and its behaviour is described in the Preamble: if all the TwoEndedSll tests pass, consider that puppy done! Complete the App.java run method so that when you run Main.java, the program behaves as expected by the MainTests. I've added a useful method in App.java that removes some of the drudgery.

1 package main; 2 3 public class Main { 4 5 public static void main(String[] args) { App app = new App(); app.run(); } 7 09 9 } You're going to be making a Two Endedsli class, representing a singly-linked list that has some specific properties. Here are the details: it will be generic...so you can toss whatever reference type you want in it. you can both add and remove from this list - but only at its head or tail - no adding/removing middle bits! (this is a blessing, of course) if you attempt to remove from an empty list, it'll throw a NoSuchElementException. even though we can add/remove from either end of this list, when we get its contents, they are always in order from head to tail. you should make your Node class a static member class. What does that mean? It should be located inside your Two Endedsii class and declared as private static Node. Of course, I realize I can't force you to do so. But still...practice good practice, folks! Of the three drills in this checkpoint, this will easily take the longest to complete. But there's an upside: the list you create in this drill makes the other two drills a snap, so the time you spend here will pay off. 1 package main; 2 3 public class App { 4 5 public void run() { 7 // TODO: code this run so that it works as shown in the example output in the instructions - and so that all the tests in MainTests pass as well 8 9 10 } 11 12 13 private void display Instructions() { System.out.println("Hi! I'm the Two-Ended List app!"); System.out.println( "Every word you enter on a line will be added to me in alternating head/tail order."); System.out.println("I will turn each word to lowercase before it is added."); 15 16 17 18 System.out.println(); 19 20 System.out.println("I will show you my contents after every word."); System.out.println("I will stop when you enter an empty line."); 21 22 23 System.out.println("Ready? Start entering words!"); 24 } 25 } 1. Create a TwoEndedsll class in the main package. This class represents a list that you modify and its behaviour is described in the Preamble: i. if all the Two Endedsil tests pass, consider that puppy done! 2. Complete the App.java run method so that when you run Main.java , the program behaves as expected by the MainTests. i. I've added a useful method in App.java that removes some of the drudgery

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

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago