Exercise 4.4.1: (back)

;; interest : number -> number
;; Example (interest 500)  -> 20
;; Example (interest 2000) -> 90
;; Example (interest 7000) -> 350
(define (interest deposit)
  (cond
    [(<= deposit 1000) (amount-of-interest deposit 4.0)]
    [(<= deposit 5000) (amount-of-interest deposit 4.5)]
    [(> deposit 5000) (amount-of-interest deposit 5.0)]))


;; amount-of-interest : number number -> number
(define (amount-of-interest deposit rate)
  (* (/ rate 100) deposit))