I'm fairly new to Java, and I'm taking an intro course this summer. I have a exercise that requires me to create a class to play a game of Hangman. The exact question is as follows:
a. The secret word
b. The disguised word, in which each unknown letter in the secret word is
replaced with a question mark (?). For example, if the secret word is
abracadabra and the letters a, b and e have been guessed, the disguised
word would be ab?a?a?a?ab?a.
c. The number of guesses made.
d. The number of incorrect guesses.
It will have the following methods:
• makeGuess© guesses that character c is in the word.
• getDisguisedWord returns a String containing correctly guessed letters in
the correct positions and unknown letters replaced with ?.
• getSecretWord returns the secret word.
• getGuessCount returns the number of guesses made.
• isFound returns true if the hidden word has been discovered.
• Appropriate constructor and get and set methods.
I'm aware how to make most of the classes and the demo file to test the program, but I'm not sure how to go about implementing a word to guess letters of, a string that displays ?s and how to change question marks into characters based on a user's input.
If anyone could guide me in the right direction I would be forever grateful!
Thanks in advance!