Answered step by step
Verified Expert Solution
Link Copied!

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 5-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 2.
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 1.
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 3

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... 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_2

Step: 3

blur-text-image_3

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

Big Java, Enhanced Early Objects

Authors: Cay S Horstmann

7th Edition

1119499097, 9781119499091

More Books

Students also viewed these Programming questions

Question

Define Administration?

Answered: 1 week ago

Question

Define Decision making

Answered: 1 week ago

Question

What are the major social responsibilities of business managers ?

Answered: 1 week ago