Question: language is scheme (25 pts) Write a function (sum-up-numbers-simple L). L is a list, which may contain as elements numbers and non-numbers. The result of

(25 pts) Write a function (sum-up-numbers-simple L). L is a list, which may contain as elements numbers and non-numbers. The result of the function is the sum of the numbers not in nested lists in L. If there are no such numbers, the result is zero. For example, the result of (sum-up-numbers-simple '(a b 1 2 c 3 d)) should be 6. Test cases: L Result (100 200) (a b c) (100 a) (a 100) (a 100 b 200 C 300 d) (0) ) ( (100)) (100 (200)) (a 100 b (200) c 300 d) 300 O 100 100 600 0 0 100 400 (25 pts) Write a function (sum-up-numbers-simple L). L is a list, which may contain as elements numbers and non-numbers. The result of the function is the sum of the numbers not in nested lists in L. If there are no such numbers, the result is zero. For example, the result of (sum-up-numbers-simple '(a b 1 2 c 3 d)) should be 6. Test cases: L Result (100 200) (a b c) (100 a) (a 100) (a 100 b 200 C 300 d) (0) ) ( (100)) (100 (200)) (a 100 b (200) c 300 d) 300 O 100 100 600 0 0 100 400
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
