You may use the Picturing Programs textbook and the blog to look up functions th at you do not know. Do not consult any other programs written by you or anyone else. (No old homework, Stack Overflow, etc.)
Use define/contract
and have at least two check expects for each function.
reciprocal-squares
: number(start) number(end) -> number. Find the sum of 1/n^2
for every n
between start
and end
(including both).
start | end | sum |
---|---|---|
1 | 1 | 1.0 |
1 | 2 | 1.25 |
1 | 3 | 1.36111… |
blank-vowels
: string(word) -> string. Change every vowel (a,e,i,o,u) to an underscore (_
). Example: (blank-vowels "elephant") => "_l_ph_nt"
.
circle-circle
: number(big-radius) number(little-radius) number(turn-angle) number(n) -> image. Produce n
circles of size little-radius
around the perimeter of a circle of size big-radius
. In between each, have a central angle of turn-angle
.