/** * CS139 - Programming Fundamentals * Department of Computer Science * James Madison University * @version Spring 2016 */
For this assignment you will implement six methods to support the development of "Word Guess" games like Hangman.
The following five files represent a complete command-line hangman program:
When Hangman.java is executed, a player is presented with a series of blanks representing a hidden word. The player guesses letters; if the letter is in the word, the word is updated to reveal the letter of that guess filled into the correct spots in the word. If the player does not guess a letter in the word, he or she receives a strike. If the player guesses the word (reveals the last letter) in fewer than 6 guesses, they win. If it takes more than 6 guesses, they lose. In this assignment, if a player guesses a letter that they have already guessed, it is not counted as a strike. Sample output from one such game can be found here.
The last three files are provided only as an example, and they will not be used in grading your assignment. You should build and test WordGuess.java incrementally -- as you are writing each method -- rather than trying to test with Hangman.java all at once.
The following terms will be used consistently throughout the method descriptions below.
theWord
userWord
guess
strikes
guesses
public static String makeUserWord(String theWord)
public static boolean isInWord(char guess, String theWord)
public static String updateUserWord(char guess, String userWord, String theWord)
public static String updateGuesses(String guesses, char guess)
public static String displayUserWord(String userWord)
public static String displayGuesses(int strikes, String guesses)
Before the deadline for Part A you should read this document carefully. Once you have a clear understanding of the expectations for this assignment, complete the readiness quiz in Canvas. The grading for this quiz will be all or nothing: your score on the quiz will be 0 if you miss any questions. If you do not successfully complete Part A, you cannot receive any credit for Part B.
Combine your WordGuess.java and WordGuessTest.java into a zip file, and submit via Web-CAT. Do not include any other files in your zip archive. WordGuess.java must conform to the CS 139 Style Guide.
Your submission will be graded using the following criteria:
Points | |
---|---|
Web-CAT Correctness/Testing | 50 |
Web-CAT Checkstyle Tests | 20 |
Style and Code Organization | 20 |
If Web-CAT deducts any points for correctness/testing, you will receive at most 25/50 on that component of the score.
Once again there will be a penalty for excessive submissions. The first 10 submissions are free. Each submission beyond 10 will result in a .5 reduction in the final score.
This assignment must be completed individually. Your submission must conform to the JMU Honor Code. Authorized help is limited to general discussion on Piazza, the lab assistants assigned to CS 139, and the instructor. Copying work from another student or the Internet is an honor code violation and will be grounds for a reduced or failing grade in the course.
This assignment was originally developed by Chris Mayfield, Nancy Harris and others.