CSSE 220 – Object-Oriented Software Development

Homework 18

Objectives

Practice object-oriented design.

Tasks

  1. Complete the assigned reading for the next session: Big Java, §13.4–13.5 and §14.1–14.3. (See schedule for topics to focus on.) As you read, see if you can answer the self-check questions. If there is something you do not understand, make note of it so you can ask about it.
  2. Complete both of the assessment exercises over this reading on ANGEL (under Lessons → Assignments).
  3. Pair Programming: Work with your assigned partner to finish the BallWorlds exercise.

    This is a pair programming assignment. You must work together following the rules of pair programming. That means one driver and one navigator working on a single copy of the program at a time. If I find that either member of your pair worked on any of the required stages of the assignment independently, that is grounds for that member to receive a zero for the assignment.

  4. Solo Programming (due at start of session 21 on Friday):
    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. In-class exercise: Complete the isPalindrome() method in the Sentence class. Your solution must be recursive.
    3. Implement, including JUnit tests, the reverse() method in the Sentence class. Your solution must be recursive.
    4. 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

Turn-in Instructions

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