S2009 Midterm

S2009 Midterm - CS 116 Spring 2009 Midterm 2 Monday, June...

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

View Full Document Right Arrow Icon
CS 116 Spring 2009 Midterm 2 Monday, June 29 The following notes are relevant for all questions: We use the term “Scheme” as a short form for “Advanced Student Scheme.” Supply exactly the parts of the design recipe requested in each question. For each helper function you create, supply the contract , purpose and body . All solutions must be placed in this booklet. If you need more space to complete an answer, please continue on the blank page on the back of the exam (and indicate that you have done so, to have it marked). Relax! Read this instruction as often as needed. 2
Background image of page 1

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

View Full DocumentRight Arrow Icon
1. [9 marks total] (a) [5 marks] Suppose the following Scheme expressions have been entered into the In- teractions window in DrScheme, in the order that appears below. Using the memory model shown in class, draw a picture showing the assignment of values to variables. ( define num1 8) ( define num2 num1 ) ( define pt1 ( make-posn 3 0)) ( define pt2 ( make-posn 3 0)) ( define pt3 pt1 ) ( define pt4 ( make-posn pt1 5)) make-X 3
Background image of page 2
(b) [4 marks] The expressions from part (a) are repeated here for your convenience: ( define num1 8) ( define num2 num1 ) ( define
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

S2009 Midterm - CS 116 Spring 2009 Midterm 2 Monday, June...

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

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