CS61A_sp97_mt2

CS61A_sp97_mt2 - CS 61A CS 61A Spring 97 Midterm 2...

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

View Full Document Right Arrow Icon
CS 61A, Spring 97 Midterm 2 Professor Harvey Problem #1 (6 points): What will Scheme print in response to the following expressions? If an expression produces an error message, 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. Also, draw a box and pointer diagram of the value produced by each expression. (list (cons 2 3) (list 4 5)) (cons (cons 2 (cons 3 4)) '()) (append '() '(a b)) (cdar '((1 . 2) (3 4))) Problem #2 (4 points): True or false? ____Tagging complex numbers with rectangular or polar as in section 2.42 could be avoided if the different representation contents were distinguishable. ____In both its verions in section 2.4.1, (make-from-real-imag x y) always produces rectangular form. ____A generic add as in section 2.5.1 checks the types of all of its arguments. ____A generic add as in section 2.5.1 takes exactly two arguments. Problem #3 (7 points): Complete the following definitions of some basic list-manipulation operations as accumulations, filters, or maps. Fill in the table below from the numbers of selections offered. If no appropriate selection exists, write "none" and write out the solution. We give an example for part A.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
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 / 4

CS61A_sp97_mt2 - CS 61A CS 61A Spring 97 Midterm 2...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online