Exercises in this lecture  Go to the slide, where this exercise belongs -- Keyboard shortcut: 'u'  

Exercise 1
Time tables


In this exercise we will make a local Cottbus - Görlitz train time table.

Assume, for instance, that we have the following list of defined stations:

 (define stations
  (list "Cottbus" "Spremberg" "Weisswasser" "Horka" "Görlitz"))

Also assume, that the following list gives the number of minutes in between the stations

 (define minutes
  (list 22 12 26 18))

Write a function (time-table start-time) that generates a time table given that the train leaves Cottbus at start-time. Thus for instance this table.

Next, write a function (time-table list-of-start-times) that can generate a more comprehensive time table. Like this one.

I will propose that you give start-time in the universal time format. The Scheme function (current-time) gives the current time.

You can use these functions if you prefer.


Solution