All comments in your program must be professional. Obscenities, flames, slurs, slanders are not professional. Remember, somebody is looking at your code and your comments when they grade your program.
/** * * This program draws a circle. * * @author Sue Percoder * CS1121 * Fall 2007 * September 1, 2007 * Recitation Section 1 * Lab Section 3 * */
Every class must have a javadoc comment indicating what the class does. The comment must be correct English sentences. Here is an example:
/** * Draw a black circle with a white line across the middle. */
Every method must have a javadoc comment describing what it does, and a list of parameters, what they mean, and any constraints on their values (e.g., must be a positive integer), and a description of what the method returns (if it does return anything). Here is an example:
/**
*
* Find the least of three integer values.
*
* @param x One of the values.
* @param Y Another of the values.
* @param z Another of the values.
*
* @return The least of x, y and z.
*/
public int least(int x, int y, int z) {
...
All in-line comments (amongst the commands) must have a blank line before and should be indented the same amount as the code they apply to.
Your code must be indented properly. Remember, you can get Eclipse to indent your code for you by typing: ctrl-a followed by ctrl-i.
All class names must have the first letter capitalized (e.g. Scene). All method and variable names must have the first letter uncapitalized (e.g., draw). All names that are multiple words (e.g., fillOval) must have the first letter of each word capitalized, except the first letter as noted above for method and variable names.
Example class names: Scene, MyFavoriteAnimation
Example method/variable names: draw, fillOval, doSomething,
treeHeight
You must use named constants for fixed positions, sizes, etc. Do not bury literals in the code. For example, use:
g.fillOval(sunLeft, sunTop, sunDiameter, sundiameter);
where sunLeft, sunTop and sunDiameter are named constants, and NOT
g.fillOval(10, 20, 40, 40);