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, 23.06.2019 20:30
Column a of irma’s spreadsheet contains titles for each row, but her document is too big and will be printed three pages across. she wants to be sure that every page will be understood. what can irma do to with this problem?
Answers: 3
question
Computers and Technology, 23.06.2019 22:30
Apart from confidential information, what other information does nda to outline? ndas not only outline confidential information, but they also enable you to outline .
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
What are "open-loop" and "closed-loop" systems
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
Answers: 1
You know the right answer?
Design and implement a word unscrambler game in Java.

Instructions
Your program...
Questions
question
Mathematics, 17.07.2019 18:00
Questions on the website: 13722367