Calvin seal CS 108: Introduction to Computing
Spring 2006

Written Assignment for Chapter 4

See the schedule for when this assignment is due.

Do these exercises from Exercises 4.2 (pages 182, 183): #6, #9, and #11.

To "do an exercise", you must do three things:

  1. Write a complete OCD design for the method.
  2. Write down at least five input-output data pairs for testing the method.
  3. Write the Java code for the method itself.

Keep in mind that these are all computation methods, not main() drivers. There should be absolutely nothing about screens or keyboards in this assignment.

However,

  1. Write everything by hand. No typing. While I run the risk of bad penmanship, I've found that students are often thrown on quizzes by having to write a method, rather than type it. Typed assignment will be thrown out, and you'll have to do it all over.
  2. You do not have to include comments.
  3. You do not have to actually write the code for the test cases. Just come up with five inputs and their corresponding outputs.

For those of you worried about the number "4" here, that's solely because this is a written assignment taken from Chapter 4 of our text book. You did not miss Written Assignments #1, #2, and #3. There weren't any.