6.6

Assignment 8

home work!

Programming Language BSL

Due Date Monday 10/15 at 9pm

Purpose To design functions over lists and compound data.

Expectations
  • You should submit a single .rkt file containing your responses to all exercises via the Handin Server. We accept NO email submissions.

  • You are only allowed to use the language specified at the top of this page: failure to do so will result in a 0.

  • All steps of the design recipe are required unless otherwise specified.

Exercise 1 Design a data definition for a Video, which has a title and runtime (in seconds).

Exercise 2 Design a data definition for a Playlist, which has its own title (the title of the playlist itself) and a list of videos.

Exercise 3 Design a function impatient, which takes a Playlist, and returns a Playlist with the same title but only containing the Videos that are 90 seconds or less. The videos in the returned Playlist should be in the same order as the original one.

Exercise 4 Design a function too-long? that accepts a Playlist and determines if the total runtime of all videos in the Playlist is more than 10 minutes.

Exercise 5 Design a function playlists-runtime that determines the total runtime in minutes of a list of Playlists. The return value can be a fractional number of minutes (e.g., 12.5). Don’t forget to make sure all of the data definitions in your signature(s) are well defined.