9.17 midterm-A05

9.17 midterm-A05 - CS1102, A05 Midterm Exam Name: Problem 1...

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

View Full Document Right Arrow Icon
CS1102, A05 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 and the following primitive operations: empty? cons? cons first rest list append map filter length number? + - * / = < > < = > = zero? 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 registrar maintains information about each course as a structure containing the course title, professors’ names, maximum enrollment, and a list of names of students in the course. The following data definition captures course info: ;; A course is a (make-course string list[string] number list[string]) ( define-struct course ( name profs max-seats students )) ;; Example ( make-course " CS1102 " ( list " Fisler " " Gennert " ) 84 ( list " Paolo " " Jennie " " Wilson " )) In the following problems, you may use Scheme’s built-in function
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-A05 - CS1102, A05 Midterm Exam Name: Problem 1...

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