CS 110 Introduction to Computing
Fall 2003

Project #6: Word Game: Hangman

Due in class on Wednesday December 10, 2003

 

See below for notes on the deadline.

Write a Java program that plays the game of Hangman. Your program should have the following:

  1. A graphical user interface
  2. The letters should be selected by creating buttons (see applet below) which can be active or inactive depending on the state.
  3. The program should display graphically the status of "hangman". See the blue/cyan pane in the applet below.
  4. The program should display the number of guesses as well as the average number of guesses per word.
  5. Allow a maximum of 6-8 guesses per word (fix the number based on your creation of the hangman graphic).
  6. A dictionary class conatining words will be provided at a later date for use with your program. Its interface is discussed below.

Here is an example applet (not yet complete) for your guidance. Your applet should have similar functionality, but design the GUI on your own, this is just a sample design.



Some useful pointers and hints: Go to Implementation Notes/Schedule

   public class Dictionary {
     public static final int nWords; // #of words contained in dictionary
     
     public Dictionary() {
     // creates a new dictionary of nWords
     ....
     }
     
     public String getWord() {
     // returns a word from the dictionary
     }
    }


Notes for the exercise:

DEADLINE: You will have to give a LIVE demonstration of your applet to the instructor. Schedule a time between December 10 and December 12 4:00p with your instructor for this. Hand in the printed project at the time of your demonstration. Hand in the printed report (described below) in class on December 10.

Since this is the last project of the semester, NO EXTENSIONS OR LATE SUBMISSIONS will be accepted.

  1. All work should be your own. You are only allowed to consult with the TA's and the instrcutor. No one else, no exceptions.
  2. Play close attention to the syntax. Every Java instruction has to be written with proper punctuations as well as with consistent use of upper/lower case character combinations.
  3. Make sure you enter your name in the NAME slot at the top of the program. Also, use the SIGNATURE slot in your applet.
  4. Post the applet on your web page.
  5. Once you are done with the exercise, hand in a printed (stapled) report that contains the following:



Back to: CS110 Course Materials