cs61a_sp08_mt2 - Question 1 (6 points): What will Scheme...

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

View Full Document Right Arrow Icon
Question 1 (6 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. (map list (1 2 3)) (let ((x (1 2)) (y (8 9))) (cons x (append y x))) (cons (cons 1 2) (append (18 3) ()))
Background image of page 1

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

View Full DocumentRight Arrow Icon
Question 2 (8 points): Suppose we want to represent books using OOP. We have a book class and a book-store class. For each of the following, state whether it should be an instance , child class , instance variable , instantiation variable , or class variable ; and state the associated class ( book or bookstore ). Each may be used any number of times. SICP _____________________________________ ______________ novel _____________________________________ ______________ title _____________________________________ ______________ ASUC Bookstore _____________________________________ ______________ inventory of books _____________________________________ ______________
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 University of California, Berkeley.

Page1 / 6

cs61a_sp08_mt2 - Question 1 (6 points): What will Scheme...

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