On 31/08/12 00:32, Ashley Fowler wrote:
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.
from math import pi
def sphere(r):
return (4.0/3) * math.pi *(r**3)
Be sure to use "cube" from problem (1) to find the cube of r (r^3).
Sorry I don't have access to problem 1 but luckily in Python I don't
need it!
Now just translate that into Scheme :-)
HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor