Question: I write this code for this section, it works for all parts instead part 2 > (upper-threshold '(1 2 3 4 5) 4) when I


I write this code for this section, it works for all parts instead part 2
> (upper-threshold '(1 2 3 4 5) 4)
when I run we get an output of just 123 not include 4
would you please help me with this part?
9. upper-threshold Define a function that takes two arguments, a list of numbers and a single number (the threshold). should return a new list that has the same numbers as the input list, but with all elements strictly greater than the threshold number removed. Elements that are equal to the threshold should remain. You may not use the built-in filter function as a helper function. Your implementation must be recursive. Input: A list of numbers and a single atomic number. Output: A new list of numbers that contains only the numbers from the original list that are strictly "less than" ( (upper-threshold '(3 6.2 7 2 9 5.3 1) 6) '(3 2 5.3 1) > (upper-threshold '(1 2 3 4 5) 4) (1 2 3 4) > (upper-threshold '(4 8 5 6 7) 6.1) (4 5 6) > (upper-threshold '(8 3 5 7) 2) ;9) --upper-threshold- (define (upper-threshold lst buf) (cond ((null? lst) '()) ((
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
