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 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 24.06.2019 02:20
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
Click the "draw structure" button to activate the drawing utility. draw two diastereomers of (1z,4r)−1,4−dimethylcyclodecene and name them, including (e)/(z) and (r)/(s) notation. part 1 out of 4 draw the diastereomer containing a chiral center with s configuration here. window open
Answers: 1
question
Computers and Technology, 24.06.2019 03:40
4. does the kernel phenotype distribution support the idea that the cob is the result of a dihybrid cross? what information supports your answer? if a dihybrid cross (i.e. f1 to f2 of standard mendelian crosses) is not indicated what conditions might contribute to this finding.
Answers: 2
You know the right answer?
Design and implement a word unscrambler game in Java.

Instructions
Your program...
Questions
question
Mathematics, 09.12.2021 19:50
question
Mathematics, 09.12.2021 19:50
question
Mathematics, 09.12.2021 19:50
Questions on the website: 13722361