This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: &lt;!-CS61A, Midterm #1,Fall 1997)--&gt;CS61A, Fall 1997 Midterm #1 Professor HarveyProblem #1 (3 points)What will Scheme print in response to the following expressions? If an expression produces an error message or runs forever without producing a result, you may just say &quot;error&quot;; you don't have to provide the exact text of the message. If the value of an expression is a procedure, just say &quot;procedure&quot;; you don't have to show the form in which Scheme prints procedures. Assume that no global variables have been defined before entering these expressions. (first (bf (first (bf '(back in the ussr))))) '(+ 6 7) ((lambda (x y) y) 8 3) (+ '(3 4 5)) (let ((a +) (* 3)) (a * *)) (if 6 7 8) Problem #2 (1 point)(define (triangle n) (if (= n 0) 0 (+ n (triangle (- n 1))))) When invoked, does the triangle procedure generate an iterative process or a recursive process? Problem #3 (4 points)file:///C|/Documents%20and%20Settings/Jason%20Raft...-%20Fall%201997%20-%20Harvey%20-%20Midterm%201.htm (1 of 3)1/27/2007 6:27:31 PM&lt;!-CS61A, Midterm #1,Fall 1997)--&gt;&lt;!...
View Full Document
- Spring '08
- Computer Science