Question: Problem 5 [15pt] Implement the following functions in Scheme using filter, fold-left and map. Do NOT use recursive definition for this problem 1/2 a) (5pt)
![Problem 5 [15pt] Implement the following functions in Scheme using filter,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3aeb46d30a_00466f3aeb41de19.jpg)
Problem 5 [15pt] Implement the following functions in Scheme using filter, fold-left and map. Do NOT use recursive definition for this problem 1/2 a) (5pt) Define a function allEven, which takes a list of integer numbers, and returns a list containing only the even numbers from the original list. For this problem, assume that 0 is neither odd nor even. Examples: (allEven '(0 1234)) should return (2 4) b) (5pt) Define a function checksum, which takes a list of integers, as well as one integer (as the expected sum). The function returns #t if the list sums up to the integer or #f if the list does not sum up to the integer. For example, (checksum ,(1 2 3 4) 10) should return #t, (checksum ,( 1 2 3 4) 8) should return #f. c) (5pt) Define a function zip, which takes a list of several lists with the same length, and returns an other list of lists where the n-th list is composed by the n-th elements of each list. For example, (zip ((12) (3 4))) should return ((13) (2 4)). Problem 5 [15pt] Implement the following functions in Scheme using filter, fold-left and map. Do NOT use recursive definition for this problem 1/2 a) (5pt) Define a function allEven, which takes a list of integer numbers, and returns a list containing only the even numbers from the original list. For this problem, assume that 0 is neither odd nor even. Examples: (allEven '(0 1234)) should return (2 4) b) (5pt) Define a function checksum, which takes a list of integers, as well as one integer (as the expected sum). The function returns #t if the list sums up to the integer or #f if the list does not sum up to the integer. For example, (checksum ,(1 2 3 4) 10) should return #t, (checksum ,( 1 2 3 4) 8) should return #f. c) (5pt) Define a function zip, which takes a list of several lists with the same length, and returns an other list of lists where the n-th list is composed by the n-th elements of each list. For example, (zip ((12) (3 4))) should return ((13) (2 4))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
