________ _______ __ __ _______ ___ / ____/ |/ / __ \/ / / / < / __ < / Spring 2019 Section 54 / / / /|_/ / /_/ / / / /_____/ / / / / / / /___/ / / / ____/ /_/ /_____/ / /_/ / / Quiz 04 \____/_/ /_/_/ \____/ /_/\____/_/ Friday, 1st March, 2019 NAME: ______________________________________________________ SCORE: _________ *** NO ELECTRONIC DEVICES OR NOTES OF ANY KIND MAY BE USED DURING THIS QUIZ. *** 1. Complete the truth tables below for AND and OR. AND OR ONE TWO OUTPUT ONE TWO OUTPUT 2. Below is the truth table for a predicate function called IMPLY?. ONE TWO OUTPUT #t #t #t #t #f #f #f #t #t #f #f #t Complete the IMPLY? function below so that it produces the output specified in the truth table. For full credit you should not use IF and COND in your answer. (define imply? (lambda (one two) / contd... 3. In the space provided, write a short explanation for each function listed below. FIRST REST CONS 4. Here is a short function called QUOTH. (define quoth (________ (listo) (________ ((null? ________) (printf "\$ ")) (________ (quoth (________ ________)) (________ "- ~A " (________ ________)))))) Fill in the blanks in the function so that its output matches the examples given below. > (quoth '(this is a test)) \$ - test - a - is - this > (quoth '()) \$ > (quoth '(backwards going is one this)) \$ - this - one - is - going - backwards > (quoth '(1 2 3 4 5 6 7 8 9 10)) \$ - 10 - 9 - 8 - 7 - 6 - 5 - 4 - 3 - 2 - 1 >