Question: 1 . Create a procedure called ( sumEven lst ) , where lst is a list of numbers. The procedure should return the sum of
Create a procedure called sumEven lst where lst is a list of numbers. The procedure should
return the sum of all even numbers in the input list. When the list is empty, the result should be
points total
Use a named procedure called sumEven lst to implement this task. points
Test case: sumEven
Use an unnamed procedure to directly implement this task. It will be something like:
lambda lstadd your code here where the list is the argument.
points
Create a procedure called listpushback lst newlist that adds the elements from newlist to
the back of lst Sample output: listpushback should give
points
Create a procedure called listpushfront lst newlist that adds the elements from newlist
to the front of lst Sample output: listpushfront should give
points
Create a procedure called listdrawfront n lst that returns the first n items in the lst
Sample output: listdrawfront should give points
Create a procedure called listdrawback n lst that returns the last n items in the lst Sample
output: listdrawback should give Do not use listtail. points
Create a procedure called listshuffle lst lst which returns the perfect shuffle of two lists.
The perfect shuffle of two lists is a new list created by alternately picking elements from one of
the two input lists. Since it is a perfect shuffle, assume both lists have the same length. Add
comments to describe how your algorithm for generating the perfect shuffle works. Sample
output: listshuffle a b is a b points total; points for implementation, for
comments.
There is no explicit requirement to use letform in these problems. It is something you should
use as it is appropriate to create and bind names in a local scope.
Hint: one of the list operations might be really easy to do
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
