exam3.3.2-3.3.4

374阅读 0评论2011-12-07 maunix
分类:LINUX

  1. ;; mht created on Nov 9, 2011

  2. ;; volume-cylinder : number number -> number
  3. ;; to conmute the volume of a cylinder given the radius of base disk and its height
  4. (define (volume-cylinder r h)
  5.   (* pi (* r r) h))
  6. ;;test
  7. (volume-cylinder 1 3)

  8. ;; area-cylinder : number number -> number
  9. ;; to consume the surface area of the cylinder given
  10. ;; the radius of base disk and its height
  11. (define (area-cylinder r h)
  12.   (/ 1 6 (volume-cylinder r h)))
上一篇:exam3.3.1
下一篇:exam3.3.5