10.11 final-A05

10.11 final-A05 - CS 1102, A05 Final Exam Name: Problem...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: CS 1102, A05 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 1. (Language Design 35 points) You want to develop a language to automate certain tasks in an instant messaging system. A messaging user can write programs that declare other users as their buddies and automatically send messages to buddies depending on criteria such as the time of day or whether a buddy is logged in or has unread messages. Each automatic message can be sent daily or only on certain days of the week. Heres a sample instant messaging program. Buddies have a nickname and a username. Times are given in 24-hour format. buddy Maria mgalvez buddy Jack boxedin buddy Pat pat46 at 21:00 {friday, saturday} send Jack "off to party" ; at 14:30 {tuesday, thursday} if Pat logged-in send "play ball?" ; for-all-buddies logged-in at 11:45 daily send "lunch anyone?" ; at 21:00 saturday if Maria has-unread-msgs send "U R 2 quiet" ; (a) (25 points) The following data definition captures one command needed to define the messaging language.(a) (25 points) The following data definition captures one command needed to define the messaging language....
View Full Document

Page1 / 7

10.11 final-A05 - CS 1102, A05 Final Exam Name: Problem...

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