Commit e1e2d1ab authored by rokka's avatar rokka

A3

parent 5ce89d1e
;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname A31) (read-case-sensitive #t) (teachpacks ((lib "universe.rkt" "teachpack" "2htdp") (lib "image.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "universe.rkt" "teachpack" "2htdp") (lib "image.rkt" "teachpack" "2htdp")) #f)))
; Radius is a Number
; interp. the radius of an cylinder in cm
; Height is a Number
; interp. the height of an cylinder in cm
; Cylinder-Volume is a Number
; interp. the volume of an cylinder in cm^2
; Radius, Height -> Cylinder-Volume
; computes cylinder-volume using the given radius and height
(check-expect (cylinder-volume 0 4) 0)
(check-expect (cylinder-volume 4 0) 0)
(check-expect (cylinder-volume 1 1) pi)
(define (cylinder-volume radius height)
(* pi (* height (expt radius 2))))
; Cylinder-Area is a Number
; interp. the area of an cylinder in cm^2
; Radius, Height -> Cylinder-Area
; computes the cylinder-volume using the given radius and height
(define (cylinder-area radius height) 0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment