Homework Assignment 4: A Simple Hangman Game
Computer Science II
Object-Oriented Programming
Due: Friday, February 10, at 11:59 AM
Introduction
This assignment asks you to design your own object-oriented program and build it "from scratch".
You are to write a Java program that allows a user to play the word game hangman. Your version of hangman should play as follows:
- 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.
- A simple textual interface can be used to interact with the player, it should include a list of the guessed letters, a list of the unguessed letters, the number of guess so far, etc. (Later in the semester, you will be asked to reimplement this assignment using AWT components.) For example, your interaction might look something like:
...
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