0.3  Exercise

Grader: Eric

Points: 4pt

The glide ratio of an airplane specifies how fast the airplane loses altitude when flown without the engines working. A glide ratio of 20 means that the airplane loses one foot of altitude for every 20 feet of distance covered.

Develop a function that tells pilots whether they can reach an emergency landing strip at a given distance away, given their airplane's current altitude and glide ratio.


;; reach : Number Number Number  -->  Boolean
;; can we reach a point in distance d, given altitude and glide-ratio
;; given: 8000 100 20, 8000 / 20 = 400, 400 <= 100 is false (can't reach it)
;; given: 2000 100 20, 2000 / 20 = 100, 100 <= 100 is true (can just reach it)
;; given: 1000 100 20, 1000 / 10 = 10,  10 <= 1000 is true (can reach it)
(define (reach d altitude glide-ratio)
  (<= (/ d glide-ratio) altitude))