CSC 160
Homework 4

Assigned June 10, due June 16

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.

For this and the next homework assignment, I recommend using list notation rather than nested-cons notation for your examples.


Grading standards

Error log:       /60

convert-reversed Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
convert extra credit Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
plot-points Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
count-over-100K Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
give-10%-raises Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
fire-over-100K Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
add-vote-for Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
count-votes Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
winner Contract:   /10 Examples:   /10 Definition:   /20 Results:   /10
winner extra credit     Definition:   /5 Results:   /5
election Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
table-of-squares Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
table-of-squares composed with plot-points Prediction:   /5
orange-stack extra credit Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
11.4.7: is-not-divisible-by<=i Contract:   /5 Examples:   /5 Definition:   /10 Results:   /5
11.4.7: prime? Contract:   /5 Examples:   /5 Definition:   /10 Results:   /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:         /500


Last modified:
Stephen Bloch / sbloch@adelphi.edu