Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this Java project, the user will be trying to make the longest possible word ladder. A word ladder is a sequence of distinct words
In this Java project, the user will be trying to make the longest possible word ladder. A word ladder is a
sequence of distinct words having the same number of letters in which each word has exactly one index
in which the letter is different from the letter in that index in the previous word.
To begin the program, read in the words from the file words.txt For full credit, read the entire file at the
beginning of the program and do not read it again.
Following that, choose a random letter word and display it as the start word. Then begin prompting
the user for a subsequent word. Continue prompting the user until one of the following three conditions
occurs:
The user enters something that is not a word not in the words.txt file
The user enters a word that has already been used.
The user enters a word that does not follow from the previous word.
Once the user makes one of those three errors, print which one occurred. You only need to print one
reason for ending even if there are multiple reasons. Then print a list of all possible words the user could
have entered or a message that there are no such words, if appropriate Finally, print the users score,
which is the number of correct words entered by the user.
You may assume that the user will always input their word as a string of capital letters.
When you are finished, submit your java file on Blackboard. Late submissions will not be accepted.Start word: SUETS
Enter Word: SUITS
Enter Word: SUITE
Enter Word: GUITE
GUITE is not a word!
You could have entered any of the following words:
QUITE SHITE, SKITE, SMITE, SPITE, SUETE
Your final score is
Start word: PERKY
Enter Word: JERKY
Enter Word: PERKY
You already used PERKY!
You could have entered any of the following words:
JERKS JERRY, KERKY
Your final score is
Start word: CAINS
Enter Word: PAINS
Enter Word: PAWNS
Enter Word: LAWNS
Enter Word: FLOWN
FLOWN doesn't follow from LAWNS!
You could have entered any of the following words:
BAWNS DAWNS, FAWNS, LARNS, LAWKS, LAWNY, LOWNS,
MAWNS, RAWNS, YAWNS
Your final score is
Step by Step Solution
★★★★★
3.37 Rating (156 Votes )
There are 3 Steps involved in it
Step: 1
It seems like youre describing the requirements for a Java program that implements a word ladder gam...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started