Computer Science 61A - Spring 1998 - Fateman - Midterm 3

Computer Science 61A - Spring 1998 - Fateman - Midterm 3 -...

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

View Full Document Right Arrow Icon
Hello my name is Ann Hsueh CS 61A Midterm #3 ver1.01 – April 13, 1998 Exam Version A Your Name: Your login: cs61a- Discussion section number: TA’s name: This exam is worth 40 points, or about 13% of your total course grade. The exam contains seven 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: 1. Write a brief scheme expression that generates the following stream (2 marks): { (1) (1 2) (1 2 3) (1 2 3 4) (1 2 3 4 5) (1 2 … ) … } file:///C|/Documents%20and%20Settings/Jason%20Raft. ..0Spring%201998%20-%20Fateman%20-%20Midterm%203.htm (1 of 8)1/27/2007 6:29:49 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
Hello my name is Ann Hsueh 2. Given the following definition: (define (stream-maker start fn) (define result (cons-stream start (stream-map fn result))) result) For each of the following streams, can you create the stream from one call to stream-maker? If "yes" then provide the call. If "no" then just write "no". (2 marks total) The stream of zeros and ones 0 1 0 1 0 1 0 1 0 1 0 1 … The stream of words like b ban banan bananan banananan … 1. Construct the stream of data { 0 1 10 11 100 101 … } that looks like the integers in binary. (2 marks) Hint 1: You can use our old friend the word function to compute (word 1 1) to make 11. Or you
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 05/17/2009 for the course CS 61A taught by Professor Harvey during the Spring '08 term at University of California, Berkeley.

Page1 / 8

Computer Science 61A - Spring 1998 - Fateman - Midterm 3 -...

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