CS61A_sp99_mt1

CS61A_sp99_mt1 - CS61A, Midterm #1, Spring 1999 CS61a,...

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

View Full Document Right Arrow Icon
CS61a, Spring 1999 Midterm #1 (Total: 20 points) Question #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 (other than the predefined Scheme primitives). (word 'for '(no one)) (if (first 'flying) 'yes 'no) (every (lambda (w) (last (butlast w))) '(think for yourself)) (let ((first last) (last first)) (first (last '(tomorrow never knows)))) CS61A, Midterm #1, Spring 1999 CS61a, Spring 1999 Midterm #1 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
((lambda (a b c) (word b a c)) '(i want you)) ((lambda (a) (a 3)) (lambda (x) (word x x))) Question #2 [4 points] Write a procedure n-to-nth that takes a positive integer n as its argument, and returns the value of
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/23/2010 for the course CS 61A taught by Professor Harvey during the Fall '08 term at Berkeley.

Page1 / 6

CS61A_sp99_mt1 - CS61A, Midterm #1, Spring 1999 CS61a,...

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