Lab Quiz Solutions, Foundations of Computing, Week 2 -- Oct 3, 2000

This quiz is just exercise 3.9 from Simply Scheme (p. 38 in the first edition).

The expression (+ 8 2) has the value 10. It is a compound expression made up of three atoms. For this quiz, write five other Scheme expressions whose values are also the number 10:

  1. An atom

    10 --- not (10) !

  2. Another compound expression made up of three atoms

    (- 12 2) --- many other expressions would work also

  3. A compound expression made up of four atoms

    (+ 5 3 2) --- others would work

  4. A compound expression made up of an atom and two compound subexpressions

    (+ (+ 3 2) (- 8 3)) -- others would work

  5. Any other kind of expression

    (+ (* 4 2) 1 1) -- etc.