



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Objective
baseball trigonometry stapler phone tree Implementation Details Since arrays haven't formally been taught yet, in order to receive full credit on this assignment you must NOT use arrays and use Strings only. Output Details For each turn of the game, you will show the user, the current state of the board. Separate each letter with a blank. In the beginning, the current state of the board is all underscore characters, one per letter in the word. For example, if the secret word was "baseball", then in the beginning the user would see
After the user guesses a letter, if they guess a letter in the word, then in the subsequent display, print out the capital version of that letter in the appropriate slot(s). In general, once a letter has been guessed, its capital version should always be printed out instead of an underscore on all subsequent boards. If the user guesses 'b' for his/her first letter, then the subsequent board to be displayed should look like this: B _ _ _ B _ _ _ If the user guesses 'e' for their second letter, then the next board displayed should look like this: B _ _ E B _ _ _ If the user makes five wrong guesses before the board is completed, print out: Sorry, you have not guessed the correct word in time. The correct word was X X X X. You lose. If the user guesses the word correctly before guessing five incorrect letters, then print out: Congratulations, you win! Here is the final board: X X X X where the X's represent the letters in the whole word.
What is your guess? r Good job! Congratulations, you win! Here is the final board: T R E E Sample Run B Welcome to the Hangman Program! What is the name of the file with all of the words? words.txt What number word, from 1 to 5, do you want to use? 3 **Here is the board:
What is your guess?** w Sorry, that letter is not in the word. Here is the board:
What is your guess? x Sorry, that letter is not in the word. Here is the board:
What is your guess? y Sorry, that letter is not in the word. Here is the board:
What is your guess? z Sorry, that letter is not in the word. Here is the board:
What is your guess? b Sorry, that letter is not in the word. Sorry, you have not guessed the correct word in time. The correct word was S T A P L E R. You lose. Deliverables You must submit a solution to the program described above in a file named Hangman.java over WebCT. Restrictions You must use a Java 5.0 compiler to develop your program. Your program should include a header comment with the following information: your name, course number and semester, assignment title, and date. Also, make sure you include ample comments throughout your code describing the major steps in solving the problem. Grading Details Your program will be graded upon the following criteria: