Computer Science 61A - Fall 1998 - Harvey - Midterm 2

Computer Science 61A - Fall 1998 - Harvey - Midterm 2 - CS...

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

View Full Document Right Arrow Icon
CS 61A Midterm #2 - October 5, 1998 CS 61A Midterm #2 - October 5, 1998 Your name login: cs61a- Discussion section number TA's name This exam is worth 20 points, or about 13% of your total course grade. The exam contains four 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. This booklet contains eight numbered pages including the cover page. 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 ones you find easier. READ AND SIGN THIS: I certify that my answers to this exam are all my own work, and that I have not discussed the exam questions or answers with anyone prior to taking this exam. If I am taking this exam early, I certify that I shall not discuss the exam questions or answers with anyone until after the scheduled exam time. Question 1 (4 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 file:///C|/Documents%20and%20Settings/Jason%20Raft. ..-%20Fall%201998%20-%20Harvey%20-%20Midterm%202.htm (1 of 6)1/27/2007 6:27:30 PM
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS 61A Midterm #2 - October 5, 1998 prints procedures. Also, draw a box and pointer diagram of the value produced by each expression. (append (list 'a 'b) '(c d)) (cons (list 'a 'b) (cons 'c 'd)) (list (list 'a 'b) (append '(c) '(d))) (cdar '((1 2) (3 4))) Your name login cs61a- Question 2 (5 points): An association list is a list of pairs, each of which associates a name (the key ) with a value. For example, the association list
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.

Page1 / 6

Computer Science 61A - Fall 1998 - Harvey - Midterm 2 - CS...

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