Homework 1 Answers Part I 1. a) 10 b) (10 1 2 3) c) (44 a b c) d) (10 44) e) (10 (1 2 3)) f) (x y) g) a h) (b c) i) 54 2. a) 10 b) 5 c) 3 d) 66 e) 15 Part II 1. (define pi 3.14159) (define (square x) (* x x)) (define (circle-area r) (* pi (square r))) 2. (define (fact n) (cond ((< n 0) error "Cannot find factorial of a negative number") ((<= n 1) 1) (else (* n (fact (- n 1)))) ) ) 3. (define (make-point x y) (list x y)) (define (x-point p) (car p)) (define (y-point p) (cadr p)) 4. (define (positive-only lst) (if (null? lst) '() (let ((head (car lst)) (rest (positive-only (cdr lst)))) (if (> head 0) (cons head rest) rest ) ) ) )