Homework #2

Assigned: January 20
Due: February 1, 4:30pm


Note: For full credit, these functions must strictly follow the Twenty Commandments, especially the first, second, eleventh, twelfth, and thirteenth.
  1. (5 points) [EOPL] exercise 1.16 (only part 4) on p. 26.

  2. (5 points) Define a Scheme function applytoall which accepts two arguments, a function and a list, applies the function to every element of the list, and returns a list of the results.

    Examples:
    > (applytoall (lambda (x) (list x x)) '(oh my))
    ((oh oh) (my my))
    
    > (applytoall (lambda (x) (* x x)) '(1 2 3 4 5 6))
    (1 4 9 16 25 36)
    

  3. (5+15+5=25 points) [EOPL] exercise 1.17 (parts 1, 2, & 3) on p. 27.

  4. (10+10=20 points) [EOPL] exercise 1.18 (only parts 1 & 2) on p. 27.


Return Home