Understand the problem

Have a clear idea of what the method is supposed to do. To test your understanding, make sure that
  1. you can state the method purpose in one simple English sentence (say, at most 25 words, preferably 10).
  2. if somebody else had written the method could distinguish correct results from incorrect results.
Also think about how you would solve the problem if computers had never been invented.

If you're sitting at the computer, you can write down the statement of purpose in a Java comment, e.g.

/**
 *  cube : Find the cube (third power) of a number
 */
or
/**
 * howOld : produce a formatted message showing a person's name and how
 * old (s)he is.
 */

Last modified: Fri Feb 20 09:55:18 EST 2009
Stephen Bloch / sbloch@adelphi.edu