If you have anything you want the readers to know before grading your program. Please write it to a file called "README" and submit it with your "WheeOfFortune.java" file. You will get the maximum of ten points if your program has good style (5 points) and correct functionality (5 points). Style ----- At this early stage, learning to code with a good style is vital. Sun has coding standards that are specifice to Java. We will use the example programs that are posted on the class web page and Sun's to grade your style. We don't expect you to learn everything about style on your first java program. But we would like you to show that you do pay attention to style when writing your program. Here is the grading scale for style: 1 pt: Good indentation. To get this point, you need to have all the following: - Lines are not longer than 80 characters. - When an expression does not fit a single line, break it accordingly. See Sun's code conventions on good indentation http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#313 1 pt: Good naming conventions To get this point, you need to have good naming conventions for class, method and variable. See Sun's code conventions on naming http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#367 1 pt: Information at the top of the file for the homework name (Homework 7), the file name (WheeOfFortune.java) and the information about the author, full name and email address: /* * Homework 7 * Class description goes here. * * Author Firstname Lastname */ class WheelOfFortune { ... } 1 pt: Good block comments. To get this point, you need to have good block comments for all the methods of the class. A block comment should describe what the method does, what parameter(s) that it accepts and what it returns if there is a return type. /** * ...main method documentation comment... * args description */ public static void main(String[] args) { // ... implementation goes here } /** * ... method doSomething documentation comment... */ static void doSomething() { // ... implementation goes here } /** * ... method doSomethingElse documentation comment... * someParameter description */ static void soSomethingElse(int someParameter) { // ... implement goes here } 1 pt: Good single-line, trailing and end-of-line comments (Excerpt from Sun's code conventions). - A single-line comment describes a code fragment. If the commment cannot be in a single line, use the block comment format. The comment should be indented to the level of the code that follows. See TextBox.java for example of good single-line comments. - Trailing comments appear at the same line of the code they described. They shoud be shifted far enough to seperate them from the statments. If more than one short comment appears in a chunk of code, they should all be indented to the same tab setting. Here's an example of a trailing comment in Java code: if (a == 2) { return TRUE; /* special case */ } else { return isPrime(a); /* works only for odd a */ } - End-of-line comemnts The // comment delimiter can comment out a complete line or only a partial line. It shouldn't be used on consecutive multiple lines for text comments; however, it can be used in consecutive multiple lines for commenting out sections of code. Examples of all three styles follow: if (foo > 1) { // Do a double-flip. ... } else { return false; // Explain why here. } //if (bar > 1) { // // // Do a triple-flip. // ... //} //else { // return false; //} Functionality ------------- Here is the grading scale for functionality: 1 pt: Correct file name and class name. WheelOfFortune.java and WheelOfFortune.class. You will lose this point if either name is wrong. 1 pt: The program compiles and the program does not crash when given correct input. You will lose this point if your program crashes on any valid input. 1 pt: It comes close to playing, but has some problems. To get this point it should read from the file, display the first line converted to *s, accept user input for guessing letters, and update the string of *s to show correctly guessed letters. 1 pt: It gets through one round with no errors. 1 pt: It plays a complete game with no errors. Things that will cost you points -------------------------------- -1 pt : Hardcode the filename. You will lose 1 point if you always open the same file, instead of reading the file from the command line. -2 pts: Hardcode the puzzle(s). You will lose 2 points if you have the puzzles as strings in your source, instead of reading them from a file. -1 pt : Hardcoding the seed value. You will lose 1 point if you hard code the seed value, instead of reading it from the command line. -1 pt : Print messages don't match specs. You will lose 1 point if your messages dont match those in the specs exactly. -1 pt : No code for presenting the string with letters replaced with *s. (The code doesn't have to work, but you should try. comment it out if it breaks things.) -1 pt : No code for finding letters in the puzzle. (The code doesn't have to work, but you should try. comment it out if it breaks things.) -1 pt : No code for controlling the flow of the game. (The code doesn't have to work, but you should try. comment it out if it breaks things.) Things that will earn you extra credit -------------------------------------- You must have a score of 8 or higher on this program to be eligible for extra credit. Handle the basics first. It's also a good idea to let the readers know you have done the extra credit. 2 pts: Making the computer opponent smart enough to not guess the same letter twice, or making the computer opponent smart enough to guess letters based on their frequency.