CSC 160
Homework 8

Assigned 25 Apr, due 4 May

Some of the following problems call for "designing a data structure". By this I mean
  1. write an English-language data definition,
  2. write a define-struct,
  3. write down the contracts of all the functions that "come for free" with the define-struct,
  4. write a template for functions that take a parameter of this type. Note that once you've written this for a given struct, you can copy-and-paste it as a starting point for every function that takes in this kind of parameter.

For example, if I were to say

Design a structure to represent an employee, with a name, salary, and employee ID number,
you might answer as follows:

Problems on posns

Problems on other structs

Problems on lists

What to turn in and how

As usual, turn in a log of how many errors of different kinds you encountered in the assignment, with brief comments describing each one. You may do this using the PSP forms, or simply by keeping track in a text file or on paper and turning it in.

Grading standards

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

I sha'n't actually grade all the programming problems; consider the others "practice". For each function I grade, see the table below.

The table below has columns for each step in the design recipe. You won't turn in a separate skeleton and definition, but rather write a skeleton and then add stuff to turn it into a definition. However, if you don't get the definition working, you'll still get partial credit for a correct skeleton.

Contract Data analysis (if applicable) Examples Skeleton Definition Test results Working animation (if applicable)
/5 /5 /5 /5 /10 /5 /10

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:         /???


Last modified:
Stephen Bloch / sbloch@adelphi.edu