10.11 final-A04

10.11 final-A04 - CS 1102, A04 Final Exam Name: Problem 1 2...

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

View Full Document Right Arrow Icon
CS 1102, A04 Final Exam Name: Problem Points Score 1 35 2 30 3 35 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 models, but you may develop them if they will help you write the programs. Your programs may contain only the following Scheme syntax: define define-struct cond else lambda let local define-syntax define-script begin and the following primitive operations: empty? cons? cons first rest list map filter append number? + - * / = < > < = > = zero? symbol? symbol = ? equal? eq? string? string = ? boolean? and or not printf and the functions introduced by define-struct . You may, of course, use whatever constants are necessary. You are not required to use map and filter in your answers. 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. (Language Design – 35 points) Imagine that you are developing a language to capture the moves of one player in a simplified soccer game. The player can kick the ball hard (trying to score), kick it gently (to move it forward), pass the ball in some direction, or run in some direction (where a direction is forward, backward, left, or right). When the player’s team has the ball, the player’s program (the offense program) might informally look like
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.

Page1 / 5

10.11 final-A04 - CS 1102, A04 Final Exam Name: Problem 1 2...

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