Procedural Decomposition Assignment

Consider this program.

  1. Identify what is good about the program, what is done right.
  2. Identify what is wrong with the program, needs improvement.

Hopefully one of the items you identified above is there is a lot of redundancy. On paper, identify the redundancy by answering the following:

  1. How many sections of repeated code are there?
  2. For each group of repeated code, identify the lines numbers of the repeated blocks.
  3. We will be creating static methods to eliminate the redundance and clarify the structure of the program. Come up with a method name for each group of repeated code. Remember, when you create a method you are defining a new action word (verb) for the Java language. Make sure you follow the proper method naming protocols!
  4. Write a proper Java static method for each of the repeated groups. Write good code, with proper curly brace alignment and indentation!
  5. Rewrite the 3 worker methods (drawDiamond, drawX, and drawRocket) using these newly created methods.
  6. Now, write the code in jGrasp and get it running!
  7. Once you have it running and producing the correct output, play with it. Combine the shape methods to create new pictures.
  8. Create new shape methods to create new pictures.

Be prepared to show and discuss what you've found!