CSSE 220 – Object-Oriented Software Development

Homework 21

Objectives

Practice object-oriented design.

Tasks

  1. If you haven't already done so, do the quite brief Cycle 0 Evaluation of Team Performance survey on Angel, under Lessons → Assignments (at the top of the list).
  2. Complete the assigned reading for the next session: Big Java §13.4–13.5 and §14.1–14.3.
  3. Complete the assessment exercises over this reading on ANGEL (under Lessons → Assignments).
  4. Team Assignment: Working with your team, complete the assigned milestone of the Vector Graphics:
  5. Solo programming: Make a “good faith effort” on the following exercises from the Recursion project that you checked out in class. Your solutions to all the following must be recursive.

    1. Complete the isPalindrome() and isPalindrome(int first, int last) methods in the Sentence class of the examples package, if you have not already done so.
    2. Implement, including JUnit tests, the reverse() method in the Sentence class.
    3. Complete the recursive drawSierpinski() method in the SierpinskiRenderer class in 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:
      1. Draw a solid equilateral triangle.
      2. In a contrasting 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

    Turn-in Instructions

    Turn in your programming work by committing it to your SVN repository.