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 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
question
Computers and Technology, 24.06.2019 00:30
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Auniform resource locator (url) is a formatted string of text that web browsers, email applications, and other software programs use to identify a particular resource on the internet. true false
Answers: 2
You know the right answer?
Design and implement a word unscrambler game in Java.

Instructions
Your program...
Questions
question
Mathematics, 30.04.2021 20:50
question
Mathematics, 30.04.2021 20:50
question
Mathematics, 30.04.2021 20:50
question
Mathematics, 30.04.2021 20:50
question
Mathematics, 30.04.2021 20:50
question
Chemistry, 30.04.2021 20:50