CSC 160
Homework 5

Assigned June 16, due June 22

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, I, 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). You may do this using the PSP forms, or simply by keeping track in a text file or on paper and turning it in.

I recommend using list notation rather than nested-cons notation for your examples.

Grading standards

Essay:       /200

Error log:       /45

Problem Contract Examples Definitions Results
permutations and auxiliaries   /20   /20   /40   /20
sort-posns-by-x   /5   /5   /10   /5
general-sort   /5   /5   /10   /5
Re-write sort       /10   /5
Re-write sort-posns-by-x       /10   /5
sort-candidates   /5   /5   /10   /5
ranked-election   /5   /5   /10   /5
Re-write give-10%-raises       /10   /5
count-if   /5   /5   /10   /5
Re-write count-over-100k       /10   /5
do-twice   /5   /5   /10   /5
iterate   /5   /5   /10   /5

General skills:

Following directions /20
Writing contracts from word problems /20
Choosing examples /20
Choosing names /20
Coding /20
Code re-use and choice of auxiliaries /20

Total:         /700


Last modified:
Stephen Bloch / sbloch@adelphi.edu