subject
Computers and Technology, 04.03.2020 02:01 1lowz1k

Design and implement a word unscrambler game in Java.

Instructions
Your program should read in a random word from a file called words. txt (note the lack of capitalization) that you provide. The file should contain:

One word per line

At least 10 different words

Each word should have at least 5 letters

Words should have variable lengths

To read a random word you can generate a random number between 1 and the number of lines, and skip n-1 lines before reading the word. Scramble the word by swapping random pairs of letters a random number of times (mandatory use of a loop). Display the scrambled word with character indices on top. Offer the user a menu with the following choices:

Enter 1 to swap a pair of letters

If this option is selected, prompt the user to enter two indices and swap the letters. A space should separate the two indices. Print an error message if the indices are invalid. If the word is unscrambled successfully, print a congratulatory message containing the word and the number of steps it took to unscramble. Otherwise, display the new word and offer the menu again.

Enter 2 to solve

If this option is selected, print the unscrambled word and quit.

Enter 3 to quit

If this option is selected, quit.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:50
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Plz ( which is an example of a good url?
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
Me ajude por favor , coloquei uma senha e não consigo tira-la no chorme
Answers: 2
You know the right answer?
Design and implement a word unscrambler game in Java.

Instructions
Your program...
Questions
question
Chemistry, 21.07.2019 22:00
question
Mathematics, 21.07.2019 22:00
Questions on the website: 13722361