CS61A_sp06_mt2 - CS 61A Midterm #2 March 7, 2006 Name:...

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

View Full Document Right Arrow Icon
CS 61A Midterm #2 – March 7, 2006 Name: Login: Discussion section number: TA: This exam is worth 40 points, or about 13% of your total course grade. The exam contains six substantive questions, plus the following: Question 0 (1 point): Fill out this front page correctly and put your name and login correctly at the top of each of the following pages. Put all answers on these pages, please; don’t hand in stray pieces of paper. This is an open book exam. When writing procedures, don’t put in error checks. Assume that you will be given arguments of the correct type. Our expectation is that many of you will not complete one or two of these questions. If you find one question especially difficult, leave it for later; start with the other ones you find easier. Question 1 (8 points): What will Scheme print in response to the following expressions? If an expression produces an error message, you may just write “error”; you don’t have to provide the exact text of the message. Also, draw a box and pointer diagram for the value produced by each expression. (cons (list ‘(a) ‘(b)) (append ‘(c) ‘(d))) (car (cons ‘((portia)) ‘(black . satin))) (caadr ‘( ((a b c) (d e f)) ((g h i) (j k l)) ((m n o) (p q r)) )) (filter (lambda (x) (if (list? x) (pair? x) (number? x)))
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.

Page1 / 4

CS61A_sp06_mt2 - CS 61A Midterm #2 March 7, 2006 Name:...

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