Due: Thursday, July 20th, 11AM PST
May be done in pairs
Your third assignment is a Hangman game that will give you practice with methods, strings and file-reading.
There is a starter project including all necessary files that you can access using the link below. Once you have the starter code set up, edit Hangman.java
so that the assignment actually does what it’s supposed to do (see the assignment handout), which will involve a cycle of coding, testing, and debugging until everything works. The final step is to submit your assignment.
This assignment may (optionally) be done in pairs. As a reminder, you may only pair up with others with the same section time and location.
Note: You may only use concepts covered up through lecture on Wednesday, July 12 to solve these problems. In particular, you may not use Java concepts you may have learned previously such as private instance variables, arrays, etc. However, you may use concepts we cover over the next week about graphics for any optional extensions if you would like. If you have any questions about what is ok/not ok to use, please feel free to ask.
To run the demo, download the zip file below and unzip, and double-click the enclosed JAR file to run. If you are unable to run it by double-clicking, right-click on the demo JAR file and click "Open".
If you would like to view them separately, the output files, which are already included in the starter code in the output
folder, are listed below as well for each task specified in the assignment handout.
Note: the "Debugging with Karel" handout still provides valuable debugging tips for Java programs! In particular, the debugger functions identically for Karel and Java programs.
import java.applet.*
; the handout has been updated to reflect this.
char
?
String
and do string processing if you would like the first character.
promptUserForFile
method to ask the user for a file name. No matter what file name I type, it never stops re-prompting me to enter the file name again and again. What is wrong?
Hangman
, so I renamed it to my own name such as DaveIsGreat
.
That is okay, right?