a) (hop 2) ;=> (cond [(zero? 2) 1] [else (local [(define x (+ 2 2))] (* x (hop (sub1 2))))]) ;=> (cond [false 1] [else (local [(define x (+ 2 2))] (* x (hop (sub1 2))))]) ;=> (cond [else (local [(define x (+ 2 2))] (* x (hop (sub1 2))))]) ;=> (local [(define x (+ 2 2))] (* x (hop (sub1 2)))) ;=> (define x_47 (+ 2 2)) (* x_47 (hop (sub1 2))) ;=> (define x_47 4) (* x_47 (hop (sub1 2))) ;=> (define x_47 4) (* 4 (hop (sub1 2))) ;=> (* 4 (cond [(zero? 1) 1] [else (local [(define x (+ 1 1))] (* x (hop (sub1 1))))])) ;=> (* 4 (cond [false 1] [else (local [(define x (+ 1 1))] (* x (hop (sub1 1))))])) ;=> (* 4 (cond [else (local [(define x (+ 1 1))] (* x (hop (sub1 1))))])) ;=> (* 4 (local [(define x (+ 1 1))] (* x (hop (sub1 1))))) ;=> (define x_48 (+ 1 1)) (* 4 (* x_48 (hop (sub1 1)))) ;=> (define x_48 2) (* 4 (* x_48 (hop (sub1 1)))) ;=> (define x_48 2) (* 4 (* 2 (hop (sub1 1)))) ;=> (* 4 (* 2 (hop 0))) ;=> (* 4 (* 2 (cond [(zero? 0) 1] [else (local [(define x (+ 0 0))] (* 0 (hop (sub1 0))))]))) ;=> (* 4 (* 2 (cond [true 1] [else (local [(define x (+ 0 0))] (* 0 (hop (sub1 0))))]))) ;=> (* 4 (* 2 1)) ;=> (* 4 2) ;=> 8 b) (local [(define num-usd 500)] (us-to-can num-usd)) ;=> (define num-usd_23 500) (us-to-can num-usd_23) ;=> (define num-usd_23 500) (us-to-can 500) ;=> (* 500 conversion-rate) ;=> (* 500 1.05) ;=> (* 500 1.05) ;=> 525 c) (local [(define conversion-rate 0.75)] (us-to-can num-usd)) ;=> (define conversion-rate_28 0.75) (us-to-can num-usd) ;=> (define conversion-rate_28 0.75) (us-to-can 1000) ;=> (define conversion-rate_28 0.75) (* 1000 conversion-rate) ;=> (define conversion-rate_28 0.75) (* 1000 1.05) ;=> ;=> (define conversion-rate_28 0.75) (* 1000 1.05) ;=> 1050