2

answers

0

watching

236

views

7 Dec 2018

# 8. 18 marks. Consider the Scheme function all-within which consumes a list of numbers and two non-negative numbers base and rarge, and produces the list of just those values that are between (base-range) and (base+range), inclusive. For example, fall-within (cons 4 (cons 10 (cons - (cors 5 (coris & (cens 1 epsy)))))) 5 3) produces (cons 4 (cons 5 (cors 8 erpcy))). a) 16 marks] Complete the definition (the header and body) of all-within b) [2 marksUse check expect to write one test for all-witrin. Do not use the given example.

8. 18 marks. Consider the Scheme function all-within which consumes a list of numbers and two non-negative numbers base and rarge, and produces the list of just those values that are between (base-range) and (base+range), inclusive. For example, fall-within (cons 4 (cons 10 (cons - (cors 5 (coris & (cens 1 epsy)))))) 5 3) produces (cons 4 (cons 5 (cors 8 erpcy))). a) 16 marks] Complete the definition (the header and body) of all-within b) [2 marksUse check expect to write one test for all-witrin. Do not use the given example.

Sixta KovacekLv2

9 Dec 2018

Already have an account? Log in