For this project you will create the game of hangman. All of the user input will be done through the command line:

1. The first player will be asked to enter a word between 4 and 8 characters long. Make sure to validate the word and if it is too short or too long have the user re-enter a different word. Spaces should also be removed.

2. Once a valid word has been entered convert the string that holds the word to all uppercase.

3. Display a window with a background color of your choice that has the hanging device drawn on it (you will need to use some of the drawing shape/line methods in Java).

4. The second player should now be shown the number of blanks for the word via the command line. Sometimes it is best to represent letter placeholders with underscores separated by a space.

5. The second player should be asked to guess a letter.

6. The guess should be converted to a capital letter. The guess could be right or wrong. If the second player guesses a letter that is in the word at least once, all occurrences of the letter in the word should be shown instead of the blank underscores. If the word is complete, the user should be congratulated, otherwise they should be asked to guess another letter. If the second player guesses incorrectly a new piece of the man should appear. Once a player reaches 7 wrong answers they have lost the game (head, neck, torso, right arm, left arm, right leg, left leg). If they have reached the limit you can inform them that it is too late, the man is dead

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.