CSC 160
Homework 2

Assigned 27 Jan, due 8 Feb

For all the programming assignments, be sure to follow the design recipe. Write your function contract, examples, and function definition in the Definitions Window, save it to a file, and send me this file. Also test your program: since you've already included examples in the Definitions window, you should be able to hit the Execute button and see all the results (along with what you said they "should be"). Save the resulting Interactions window to a text file and send me this file too. Be sure to choose meaningful names for functions and parameters, and watch for opportunities to re-use functions you (or the textbook) have already written.

Also turn in a log of how many errors of different kinds you encountered in the assignment, with brief comments describing each one ("mismatched parentheses" is self-explanatory, but more complex errors might need more description).

This assignment is to be done in pairs, using the ideas from the "kindergarten" article. Choose a partner ASAP and schedule time to work together on the assignment. When you're finished, turn in one assignment with both names on it. You'll have a different partner for homework 3, so if you don't get along with this partner, remember it's only for a week.

Grading standards

Error log:       /15
(I'm not grading on how many or how few errors you encountered, only on whether you recorded them correctly.)

Function name Contract Examples Definition Test results
counterchange /5 /5 /10 /5
checkerboard /5 /5 /10 /5
pinwheel /5 /5 /10 /5
smart-pinwheel (extra credit) /10 /10 /20 /10
convert-3-digits /5 /5 /10 /5
convert-3-reversed /5 /5 /10 /5

General skills:

Following directions /10
Writing contracts from word problems /10
Choosing examples /10
Choosing names /10
Coding /10
Code re-use and function composition /10

Total:         /200 +   /50 extra credit


Last modified:
Stephen Bloch / sbloch@adelphi.edu