Problem Set 2, CS 257
Due before 4am, Tuesday Sep 9, 1997 - i.e.
very late Monday night
Important: Turn in this problem set by running the
program ~barak/bin/submit file1.scm file2.scm ...
- Do the following problems from the book:
- Define a function harmonic which computes the sum of the
first n elements of the harmonic series:
(harmonic 0) = 0
(harmonic 1) = 1/1 = 1
(harmonic 2) = 1/1 + 1/2 = 1.5
(harmonic 5) = 1/1 + 1/2 + 1/3 + 1/4 + 1/5 = 2.2833333
- Define a procedure (bopper side) which uses the turtle to
draw a picture like that below, with the argument to the function
being the length of the first upstroke.
- Define a procedure circle-sentence which takes a sentence
and draws its words on the edge of a circle (or really an n-gon for
some large n). For instance, doing
(circle-sentence '(we can meet at your convenience my sweet little sugar plum))
should result in something like this:
All the files should be legal scheme code, with comments indicating
which fragment of code corresponds to which problem, and comments with
any answers to questions that require answers to be in English rather
You must submit all your files at once! You are allowed to
make corrections, because your last submit command overwrites any
data previously submitted.
Barak Pearlmutter <firstname.lastname@example.org>