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 "ContinuedFraction.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 5), the file name (ContinuedFraction.java) and the information about the author, full name and email address: /* * Homework 5 * Class description goes here. * * Author Firstname Lastname */ class ContinuedFraction { ... } 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. ContinuedFraction.java and ContinuedFraction.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: The program compiles, runs, and prints the correct output for at least one of the test cases. 1 pt: The program compiles, runs, and prints the correct output for at least half of the test cases. 1 pt: The program compiles, runs and prints the correct output for all test cases Things that will cost you points -------------------------------- -2 pts: Hardcode the outputs. This means your program prints the same output for whatever input we provide. You will also lose 2 points if you can only read inputs of some fixed maximum length. -1 pts: The program is interactive. This means it prompts the user for anything. 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: Reducing the continued fraction to a simple fraction correctly for all inputs.