You are required to write signatures and descriptions for all functions, and also descriptions of all your structures. Additionally, functions, except the world problems, must be tested using check-expect. Write your tests before you write a function (but feel free to add more after it's been writen).
The quality of your tests will be graded. Make sure to have enough test cases to demonstrate that the function is correct. I may take points off for a lack of testing (in addition to those taken off for incorrect behavior) if your function doesn't work on particular expected data and there is no test for it. It's much better to leave a test that fails (perhaps in comments) that shows that the function doesn't work on given data and you don't know how to fix it.
Given the family tree
structure in defined
in Section
22.1, write a function ft-has-color?
that takes a
family tree and a color and returns true if that family tree has a
person with that color of eyes, and false otherwise.
Write a function contains-all?
that consumes two lists of
numbers and returns true if the first list contains all elements of
the second one and false otherwise. For simplicity assume that neither
list contains the same element more than once.
Write a fucntion common-elements
that takes two lists of
numbers and returns the list of all elements that appear in both
lists. For simplicity assume that neither
list contains the same element more than once.
Make sure to write tests before you write the functions. You may use helper functions, local definitions, and general functions (map, filter, etc).