Question: Specific classes for this: Much like StringHelper in the previous lab, there are a few helper classes in the Autograder. class HangmanDictionary : Constructor: HangmanDictionary
Specific classes for this:
Much like StringHelper in the previous lab, there are a few helper classes in the Autograder.
class HangmanDictionary :
Constructor: HangmanDictionary
Methods:
public int getNumberOfAvailableWords this returns the number of words in this dictionary
public String getWordint wordIndex this returns a particular word in the dictionary; valid indexes start at inclusive and go up to the number of available
words exclusive
class HangmanDisplay :
Constructor: HangmanDisplay
Methods:
public void displayHangmanint numGuessesLeft this draws an ascii art representation of the hangman game when there are numGuessesLeft guesses
remaining the game ends when this value is
public void displayWordToGuessString wordToDisplay, String previouslyGuessedCharacters this displays the words involved in an inprogress
hangman game; wordToDisplay is the current partially guessed word the player is guessing, and previouslyGuessedCharacters are all the letters that the player has
tried so far
public char getLetter this prompts the user for a single character and returns it Error handling for multiple, missing, or nonletter characters is handled
internally and will not throw an exception, although the result may be upper or lower case depending on what the user entered.
public void showEndGameMessageString resultMessage displays a winloss message to the player
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
