I am making a program in Scheme (simply-scheme in Dr. Racket) that takes in a number of integers followed by the integer values. I need to be able to find the average of the list, which I have already got working and to be able to count the numbers greater than the average and display how many there are.
;;Function for the sum of list
(define (sum listlen)
(if
(null? listlen)
0
(+ (car listlen) (sum (cdr listlen)))
)
)
;;This is the part I am having trouble with
(let ((avg (/ (apply + (cdr numbers)) (car numbers))))
(count (lambda (x) (< x avg)) (cdr numbers)))
My function for finding the greater than average function is giving me an arity mismatch. it says "count: arity mismatch; the expected number of arguments does not match the given number expected: 1 given: 2 arguments...:"
I'm sure it's something simple that I doing wrong if my greater than average function but for the life of me I can't figure out what it is