Practice recursion.
isPalindrome()
and isPalindrome(int first, int last)
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. (Later we’ll see how to define our own equals()
method. Feel free to look up how to do that if you’re interested.)
Sierpiński Triangle. This problem is due as part of HW 12. However, you should make a strong effort to get started on the problem. If you come to class having done the parts you find easy, then you can get immediate help on the parts you find difficult.
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
. Pair Programming:
Complete the GameOfLife project that you started in class during session 9. Don’t forget that this is a pair programming exercise.
TODO
items in GameOfLife
and GameOfLifeTest
. The TODO
items are numbered in the order that you should complete them. getGliderList()
in GameOfLifeMain
generates a list representing the classic glider formation. TODO
items are completed. 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.