Exercise 6.3.3: (back)

;; define constant
(define base-range 250)


;; define a structure called jet
(define-struct jet (designation acceleration top-speed range))


;; within-range : jet -> jet
;; to produce a jet record like a-jet with base-range subtracted from jet-range
(define (within-range a-jet)
  (make-jet (jet-designation a-jet)
            (jet-acceleration a-jet)
            (jet-top-speed a-jet)
            (- (jet-range a-jet) base-range)))


;; reduce-range : jet -> jet
;; to produce a jet record like a-jet with 80 percent of the range
(define (reduce-range a-jet)
  (make-jet (jet-designation a-jet)
            (jet-acceleration a-jet)
            (jet-top-speed a-jet)
            (* (jet-range a-jet) 0.8)))