Problems for Lesson 8

Problem 8.1 – Evaluating cond

Show all the steps starting with the Racket expression

  (cond
   [(= 1 0) 16]
   [(>= 2 1) 17]
   [else 18])

to arrive at the result 17. Write -> (a dash followed by a greater-than sign) between steps.

Problem 8.2 – Evaluating cond, Again

Show all the steps starting with the Racket expression

  (cond
   [(= 1 0) (/ 1 0)]
   [else (+ 17 1)])

to arrive at the result 18.