Question: This exercise uses the Java LinkedList class. Using the input file words.txt, input each string putting it into a different LinkedList depending on the first

This exercise uses the Java LinkedList class. Using the input file words.txt, input each string putting it into a different LinkedList depending on the first character in the String. (Yes, you will need 26 linked lists). Then prompt the user for a (lower case) character and display all the words beginning with that character. (If the user enters an invalid character, trap them in a loop until they give you a valid one). Note: nothing is sorted. I do NOT want to see 26 if statements or 26 case Switch statements. Use your head and remember ASCII tables. EXTRA credit: Allow the user to enter any alphabetic character (lower or upper case). You will then need to convert it to lower case.

words.txt:

noncollectable

reallocation

drenching

obnoxious

venality

dybbuk

shotgun

changelessly

handiwork

unheralded

dovecote

anode

spellbind

Rubric:

Use of try/catch

use a while loop to collect input

use array of linkedlists

correctly put string into the right list

prompt user for input

display correct list

allow user to enter upper case or lower case character

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!