[Tutor] Scheme

Ashley Fowler afowler2 at broncos.uncfsu.edu
Fri Aug 31 01:32:30 CEST 2012


This is a problem using the Scheme programming...Can anybody help me with this problem?


2. Write a procedure (sphere r) that takes the radius of a sphere
as the value of its input parameter and returns the volume of that
sphere given by the formula: (4/3)π(r^3). Use (require scheme/math)
or (require racket/math) to load the math library containing the
"pi" constant.
Be sure to use "cube" from problem (1) to find the cube of r (r^3).

Tests:
(sphere 2)   ==> 33.51 ...
(sphere 5.3) ==> 623.61 ...


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120830/ad789d51/attachment.html>


More information about the Tutor mailing list