Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help in JAVA: This is an exercise in using the LinkedList class. Using input file words.txt create a LinkedList BUT you must NOT add a

Help in JAVA:

This is an exercise in using the LinkedList class.

Using input file words.txt create a LinkedList BUT you must NOT add a word that is already in the list and you MUST add them in the order received to the end of the list.

For example, if your input was cat, cat, dog, mouse, dog, horse

your list would now contain cat, dog, mouse, horse. And the head of the list would be cat, and the tail would be horse. Note: it is NOT sorted.

This list represents a code, and the code for one word is the next word in the list. So the code for cat is dog and the code for mouse is horse, and the code for horse is cat(go round to the head of the list).

Now ask your user for a phrase (input from the keyboard) and output the coded phrase. In the above example if the input was "mouse cat" the output would be "horse dog".

-I suggest you make your own (small) input file so you can test it.

words.txt:

noncollectable reallocation drenching obnoxious venality dybbuk shotgun changelessly handiwork unheralded dovecote anode spellbind psychologist improvisational prejudiced apply pokey secular masterfully at overdrawn costar scruff awareness impurely tuft minstrelsy calcimine

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago