Computers and Technology

Write a reverse Hangman game in which the user thinks of a word and the computer tries to guess the letters in that word. The user tells the computer how many letters the word contains.
Limit your program to a maximum of 6 guesses. Use a random number generator to generate the guesses. Use the following code to generate your letter guesses randomly:
// picks a letter at random that we haven't yet guessed
public static char getGuess(String guesses) {
Random r = new Random();
char guess;
do {
guess = (char)('A' + r. nextInt(26));
} while (guesses. indexOf(guess) != -1);
return guess;
}
Your program should be stored in a file called ReverseHangman. java.
Log of execution (user input underlined)
This program plays a game of reverse hangman.
You think up a word and I'll try to guess
the letters.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:40, Courtneymorris19
The most complicated four letter word
Answers: 1
image
Computers and Technology, 23.06.2019 03:30, mem81
How can you repin an image on your pinterest pin board a. click on the "repin" button b. click on the "add pin" button c. click on the "upload a pin" button d. click on the "save pin" button.
Answers: 2
image
Computers and Technology, 23.06.2019 07:10, anika420
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
image
Computers and Technology, 23.06.2019 20:00, emmaraeschool
Me ajude por favor , coloquei uma senha e não consigo tira-la no chorme
Answers: 2
Do you know the correct answer?
Write a reverse Hangman game in which the user thinks of a word and the computer tries to guess the...

Questions in other subjects:

Konu
Social Studies, 12.03.2021 23:30
Konu
Chemistry, 12.03.2021 23:30