(define (accumulate-recursive combiner null-value term a next b) (if (> a b) null-value (combiner (term a) (accumulate-recursive combiner null-value term (next a) next b)))) (define (accumulate-iterative combiner null-value term a next b) (define (iter a result) (if (> a b) result (iter (next a) (combiner (term a) result)))) (iter a null-value)) (define (sum term a next b) (accumulate-iterative + 0 term a next b)) (define (product factor a next b) (accumulate-iterative * 1 factor a next b))