assn4 - CS 135 Fall 2008 Byron Weber Becker, Ian Goldberg,...

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

View Full Document Right Arrow Icon
CS 135 Fall 2008 Byron Weber Becker, Ian Goldberg, Brad Lushman, Daniel Roche, Troy Vasiga Assignment 4 Due Wednesday, October 8, 10:30 am Files to submit: stepping.txt , titles.ss , nodups.ss , coords.ss , and (for the bonus) area.ss Language level : Beginning Student Warmup exercises : (Not to be submitted) HtDP, exercises 9.5.5, 9.5.6, 10.1.3, 10.1.4. Extra practice exercises : (Not to be submitted) HtDP, exercises 9.5.4, 9.5.8, 10.1.8, 10.3.1-6. Here are the assignment questions you need to submit. 1. Prepare a single text file stepping.txt that contains a complete step-by-step evaluation of the expressions below, using the semantics discussed in class. We highly recommend that you do this by hand, because you will have to do this on exams, and you won’t have the Stepper to help you. The following structure and variable are defined for each expression: ( define-struct labelled-posn ( posn label )) ( define lolp ( cons ( make-labelled-posn ( make-posn 0 0 ) ’ Origin ) ( cons ( make-labelled-posn ( make-posn 5 10 ) ’ Five-n-dime ) ( cons ( make-labelled-posn ( make-posn - 200 0 ) ’ Campus ) empty )))) (a) ( labelled-posn-label ( first ( rest ( rest lolp )))) (b) ( posn-y ( labelled-posn-posn ( first ( rest lolp )))) 2. Recall the definition of an mminfo from class. Write a function extract-titles , which takes a symbol (one of ’ mp3s , ’ movies , or ’ all ) and a list of mminfo s, and returns a list of strings. If the given symbol is ’ mp3s , the resulting list should be the list of titles of all mp3info structures in the input list. If the given symbol is ’ movies , the resulting list should be the list of titles of all movieinfo structures in the input list. If the given symbol is ’ all , the resulting list should be the list of titles of all structures in the input list. In all cases, the order of the titles in the output list should match the order in the input list. Place your solution to this question in a file called titles.ss . 3. Write the function
Background image of page 1

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

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

Page1 / 3

assn4 - CS 135 Fall 2008 Byron Weber Becker, Ian Goldberg,...

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

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