subject

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.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
1. which of the following is a search engine? a) mozilla firefox b)internet explorer c)google d)safari 2. which of the following statements is true? a) all search engines will provide the same results when you enter the same query. b) all search engines use the same amount of advertisements. c) some search engines are also browsers. d) search engines often provide different results, even when you enter the same query.
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Experimental data that is expressed using numbers is said to be
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Which component acts as a platform on which application software runs
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
You know the right answer?
Write a reverse Hangman game in which the user thinks of a word and the computer tries to guess the...
Questions
Questions on the website: 13722359