Computer Science 61A - Fall 1997 - Harvey - Midterm 1

# Computer Science 61A - Fall 1997 - Harvey - Midterm 1 -...

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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: &amp;lt;!-CS61A, Midterm #1,Fall 1997)--&amp;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 &amp;quot;error&amp;quot;; you don't have to provide the exact text of the message. If the value of an expression is a procedure, just say &amp;quot;procedure&amp;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&amp;lt;!-CS61A, Midterm #1,Fall 1997)--&amp;gt;&amp;lt;!...
View Full Document

{[ snackBarMessage ]}

### Page1 / 3

Computer Science 61A - Fall 1997 - Harvey - Midterm 1 -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online