PPT Slide
Writing Methods--Repaired Example
* Calculate the recurrence relation, r(n) = r(n-1) +
* r(n-2) - r(n-3), where: r(1)=1, r(2)=2, r(3)=3, n>=1.
* @param is the value of recurrence relation to calculate.
* @return the integer value of the recurrence relation at n.
public int recurrence (int iN)
util.ASSERT ( iN >= 1, “int param is less than 1”);
Lesson: while creating code that works, remember to think!