CIT 594 Programming Requirements
Spring 2003, David Matuszek

The following general requirements apply to all programming assignments in CIT 594, whether explicitly stated in the assignment or not.

  1. All programs submitted for a grade should be your own work.
  2. All programs are expected to work correctly.
  3. All programs should be properly commented.
  4. All programs should follow basic style rules.

All programs submitted for a grade should be your own work.

You may:

You may not:

Things to be especially careful about:

Anyone caught cheating will be reported to the Office of Student Conduct and will receive an F in the course. There will be no second chances.

All programs are expected to work correctly.

Programs that contain syntax errors, or that fail to work for simple cases, are worth zero points.

You are expected to test your programs thoroughly. In cases where we provide test data for you to use, you should not assume that it is enough to handle the provided data correctly--your program should work for all possible data. It is your responsibility to look for unusual cases that may need special treatment. We are likely to test your program with a different data set, and any errors will sharply reduce your grade.

All programs should be properly commented.

Supply a "javadoc" documentation comment for every class and every method. The documentation comment for each class should tell what the class is all about, and should contain @author and @version tags. For example:

/**
 * Program to convert a decimal number into a fraction.
 * 
 * @author David Matuszek
 * @version 1.2
 */

The documentation comment for each method should tell what the method does and how to use it, but should not describe how the method is implemented. It should use @param, @return, and @throws tags as appropriate, and @see # tags for each global variable that it uses. For example,

/**
 * Returns the first parameter (which may be of any integral type)
 * right-justified in a field of WIDTH characters.

 * 
 * @param n The number to be formatted.

 * @return A String containing the number "n" right-justified
 *         in a field of length "width".
 * @see #WIDTH
 * @throws NumberFormatException if the number has more than
 *         "width" digits.
 */
Internal comments should be used to separate major sections of a method and to explain any implementation details that might be confusing.

All programs should follow basic style rules.

Names:

Any statements contained within another statement should be indented relative to that statement. Indentation should consist of from 2 to 5 spaces (3 or 4 is usually best), and should be consistent throughout. Do not use tabs for indenting, only spaces (tabs are not all the same width on different platforms). Examples:

indexOfMinimum = 0;
minimum = myArray[0];
for (int i = 1; i < myArray.length; i++) {
     if (myArray[i] < minimum) {
        indexOfMinimum = i;
        minimum = array[i];
    }
}

The DRY principle is: Don't Repeat Yourself. If you find yourself writing the same code two or more times, consider whether it should be encapsulated in a method.

Other style rules may be mentioned throughout the course.