To solve interval problems, look for the pattern in each situation. Constants are used to take the focus away from numbers.

(define A 5)
(define B 10)
(define C 25)

(define BLUE 1)
(define RED 5)
(define GREEN 10)
(define PINK 25)

;;AddIt:  number -> number
;;compute percentage values within various intervals
(define (AddIt N)
  (cond
    [(<= N A) (* N  BLUE)]
    [(<= N B) (+ (* A BLUE)
                 (* (- N A) RED))]
    [(<= N C) (+ (* A BLUE)
                 (* (- B A) RED)
                 (* (- N B) GREEN))]
    (else     (+ (* A BLUE)
                 (* (- B A) RED)
                 (* (- C B) GREEN)
                 (* (- N C) PINK)))))

(AddIt 3) = 3
(AddIt 5) = 5
(AddIt 6) = 10
(AddIt 7) = 15
(AddIt 8) = 20
(AddIt 10) = 30
(AddIt 11) = 40
(AddIt 12) = 50
(AddIt 20) = 130
(AddIt 24) = 170
(AddIt 25) = 180
(AddIt 26) = 205
(AddIt 27) = 230