CSSE 220 – Object-Oriented Software Development

Homework 20

Objectives

Begin learning about recursion. Continue working with teammates on your project.

Tasks

  1. Read the first 5 sections of Chapter 14 of  Big Java.
  2. Complete the ANGEL quiz over Big Java Chapter 13..
  3. Solo Programming:
    1. Your programming work for this part must be done in the Recursion project inside Eclipse. Use the SVN Repository Exploring perspective to check out this project, then switch back to the Java perspective.
    2. (1 point) In-class exercise: Complete the isPalindrome() method in the Sentence class. Your solution must be recursive.
    3. (2 points) Implement, including JUnit tests, the reverse() method in the Sentence class. Your solution must be recursive.
    4. (7 points) Complete the recursive drawSierpinski() method in the SierpinskiRenderer class. This method should render the Sierpiński Triangle as shown in the figure below. The triangle is rendered by following these steps:
      1. Draw a solid equilateral triangle.
      2. In a constrasting color, draw another solid equilateral triangle whose corner points are the midpoints of the original’s sides.
      3. Repeat this process recursively for each of the three corner triangles. That is, you will need three recursive calls in your method.
      4. Technically speaking, this process is repeated an infinite number of times to create the true Sierpiński triangle, but we don’t have that much time. So, stop your recursion when the length of a side of the triangle becomes shorter than some fixed constant, say 5.
    Sierpinski Triangle
  4. Team Assignment: Working with your team, complete the assigned milestone of the Vector Graphics.

Turn-in Instructions

Do the quiz on ANGEL. Turn-in your individual programming work by committing it to your SVN repository.

See the Vector Graphics assignment description for team project deliverables.