9.17 Midterm-Exam

9.17 Midterm-Exam - CS1102 A04 Midterm Exam Name Problem 1 2 3 30 Total Score You have 50 minutes to complete the problems on the following pages

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

View Full Document Right Arrow Icon
CS1102, A04 Midterm Exam Name: Problem Points Score 1 35 2 35 3 30 Total You have 50 minutes to complete the problems on the following pages. There should be sufficient space provided for your answers. You do not need to show templates, but you may receive partial credit if you do. You also do not need to show test cases or examples of data definitions, but you may develop them if they will help you write the programs. You do not need to use map/filter unless a problem states otherwise (you may use them if you wish). Your programs may contain only the following Scheme syntax: define define-struct cond else lambda local let and the following primitive operations: empty? cons? cons first rest list append map filter length number? + - * / = < > < = > = zero? symbol? symbol = ? eq? string? string = ? string-length boolean? and or not and the functions introduced by define-struct . You may, of course, use whatever constants are necessary. 1
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. (35 points) The turnin system we’ve been using to submit homeworks stores information about the assignments and files submitted. Each assignment has a name, a boolean indicating whether it is open for submissions, and up to one submission per student in the class. The following definitions capture turnin info: ;; A asgmt is a (make-asgmt symbol boolean list[studentfiles]) ( define-struct assignment ( name open? submissions )) ;; A studentfile is a (make-studfile symbol string) ( define-struct studfile ( username code )) ;; Example of above definitions ( make-asgmt hwk1 true ( list ( make-studfile kfisler " kathi code " ) ( make-studfile zellers " adam code
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 02/06/2008 for the course CS 1102 taught by Professor Fisler during the Fall '07 term at WPI.

Page1 / 7

9.17 Midterm-Exam - CS1102 A04 Midterm Exam Name Problem 1 2 3 30 Total Score You have 50 minutes to complete the problems on the following pages

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