211 F '04
Set 1
Set 2
Set 3
Set 4
Set 5
Set 6
Set 7
Set 8
Set 9
Set 10
Set 11
Set 12
Set 13
Set 14

Problem Set 4

Due date: 10/4 @ 6:00 pm

The goal is to understand data definitions for unions of data and self-referential data definitions.

HtDP Problems:

7.2.1, 7.2.2, 9.5.4, 9.5.6, 10.1.7

Additional Problem 1:

A railroad uses three kinds of trains to connect Aix-a-Chapelle with Fobyo:

  1. local, which stops at all four train stations en route;
  2. regional, which stops at Amy and Brian only;
  3. express, which stops only at the destination.
All trains run every day. A train schedule for each kind of train consists of (1) the time when the train leaves Aix-a-Chapelle, (2) when it arrives at Fobyo, and (3) when it arrives at the intermediate stops, if any.

Your company supplies a software application for assisting the help desk clerks of this railroad company. Develop a data definition for the train schedules.

Develop a function that when given a train schedule and a time, determines whether the train arrives before the given time at its destination.

Additional Problem 2:

Develop a function that when given a list of Posns, creates a scene of 100 by 100 and places a solid yellow disk at each given Posn, if the coordinates of the Posn are between 0 and 100.

Additional Problem 3:

Develop the function create-movie, which when given a list of (positive) numbers, creates a list of that many solid red disks. The radius of the n-th solid disk is 10 times the n-th number in the given list. When you have developed the function, including tests, use the function run-movie to display the result of your function for some samples:

   (big-bang 200 200 0 0)
       (cons 10 ...)))

last updated on Mon Nov 29 11:44:30 EST 2004generated with PLT Scheme