Question: Topics This assignment will give you practice with file input, strings, and arrays. Instructions You are going to write a program that will allow the





Topics This assignment will give you practice with file input, strings, and arrays. Instructions You are going to write a program that will allow the user to play a game like hangman (https:/len.wikipedia.org/wikilHangman_(game)), where your program chooses a word from a text file and then displays blanks for the user to guess the word. The user will have a set number of incorrect guesses and if they do not guess the word within that number of tries, they will lose the game. Max Wrong You should define a class constant for the maximum nember of incorrect guesses that the user gets before they lose the game. You may choose this number. The more guesses the user gets, the easier the game. You should print the number of tries the user gets in the intro text to the game. Max Words You should define a class constant for the maximum number of words in the dictionary.txt file. This constant will be used when you construct the array to hold all the words in the file. Methods At a minimum, your program should have the following static methods in addition to the main: a method to load the input from a file into an array a method to pick the word for this game from the list of words . a method to print the word a method to play one game of hangman . a method to check if the word is guessed . a method to check if the guess was in the word Method: Load Input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
