Practice recursion.
There is no assessment exercise in ANGEL over this reading.
isPalindrome()
OR isPalindrome(int first, int last)
(the latter is a helper method) methods in the Sentence
class of the examples
package, if you have not already done so.
Implement, including JUnit tests, the reverse()
method in the Sentence
class.
How will you compare two Sentence
s in your unit tests? Suggestion: compare the text strings by using the Sentence
class’s toString()
method. (Since you know how to make your own equals()
method, feel free to use that if you’re interested.)
Sierpiński Triangle.
This problem is in the SierpinskiTriangle project that you should check out from your individual SVN repository.
Complete the recursive drawSierpinski()
method in the SierpinskiRenderer
class of the sierpinski
package. This method should render the Sierpiński Triangle as shown in the figure below. The triangle is rendered by following these steps:
5
. Remember, in all your code:
Here is the grading rubric for this assignment.
Turn in your programming work by committing it to your SVN repository.