Project:

Scheme, pasted on Mar 15:
 ```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 ``` ```; sum of squares of two largest of three values (define-syntax assert (syntax-rules () ((assert expr result) (if (not (equal? expr result)) (for-each display `( #\newline "failed assertion:" #\newline expr #\newline "expected: " ,result #\newline "returned: " ,expr #\newline)))))) (define (test f) (assert (f 3 4 5) 41) (assert (f 3 5 4) 41) (assert (f 4 3 5) 41) (assert (f 4 5 3) 41) (assert (f 5 3 4) 41) (assert (f 5 4 3) 41) (assert (f 3 3 4) 25) (assert (f 3 4 3) 25) (assert (f 4 3 3) 25) (assert (f 3 4 4) 32) (assert (f 4 3 4) 32) (assert (f 4 4 3) 32) (assert (f 3 3 3) 18)) (define (f x y z) (if (< x y) (if (< x z) (+ (* y y) (* z z)) (+ (* x x) (* y y))) (if (< y z) (+ (* x x) (* z z)) (+ (* x x) (* y y))))) (display "First function") (test f) (newline) (define (f x y z) (if (= x (min x y z)) (+ (* y y) (* z z)) (f y z x))) (display "Second function") (test f) (newline) (define (f x y z) (cond ((and (< x y) (< x z)) (+ (* y y) (* z z))) ((and (< y x) (< y z)) (+ (* x x) (* z z))) (else (+ (* x x) (* y y))))) (display "Third function") (test f) ```

Output:
 ```1 2 3 4 5 6 7 ``` ```First function Second function Third function failed assertion: (f 3 3 4) expected: 25 returned: 18 ```