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

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

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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

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 Right Arrow Icon
Ask a homework question - tutors are online