Homework Assignment 5 - GUI Front-End to Hangman Game
Due: Friday, March 3, at 2:59 PM
Introduction
This assignment asks you to design and implement a GUI front-end to the Hangman game. As a starting point, you may use your solution to homework #4, or you may download my solution (hw4solution.zip) (Available Thursday, but don't wait to start. You can be designing your GUI interface and playing with the API components to implement it!). This program should have the same functionality as homework #4. The same Hangman specifications apply and are given below.
I encourage you to look at past programs (e.g., MemoPad, CannonGame, etc.) as examples of how the GUI components work. Your best reference might be to read chapter 13 on the AWT API.
Be sure that your submission follows all homework submission requirements.
A Specification for a Program to Play Hangman:
- Upon startup, the game should ask the user their name, because the game needs to track players by name, number of words solved, average number of letters guessed per word, etc. If the user has never played before, the game should ask them their birthday. A player's age is used to select the difficulty of words selected for a player to solve while playing. You'll need to use files to store player information between games, and words previously categorized by difficulty.
- When playing hangman the game selects an appropriate word at random based on the player's age. Even though words are selected at random, the player should not encounter the same word more that once in a session until all of the words in that level of difficulty have been exhausted.
- In the simple, textual-interface of homework #4 the player interaction looked something like below. It included a list of the guessed letters, a list of the unguessed letters, the number of guesses so far, etc. Your GUI interaction for hangman should contain similar information and functionality, but be event-driven.
...
4 Letters Guessed: A E T R
Unguessed Letters: B C D F G H I J K L M N O P Q S U V W X Y Z
Number of incorrect word guesses: 1
T E A ___ ___ E R
Enter the next letter or your guess of the word: teacher
"TEACHER" is correct MARK! You needed 4 letters and 2 word guesses.
Would you like to play again (y or n)? y
...
- After a player solves a word, they should be asked if they would like to do another word.
- When a player quits, their session statistics and overall "lifetime" statistics should be displayed.
You are to submit electronically and on paper :
- a one page overview of the design of your program (file: readme.txt),
- a hard-copy of your program files (*.java), and
- other files needed to run your program: file(s) containing the words, and statistics of players