Exam 2 take home.

Exam 2 take home. Submit electronic copies of the lisp files to my email address by Wednesday Nov 28, 2007 at 6pm.

1. Define a function to make a Palindrome of even length from a list by repeating the reversed list, i.e., if list = (a b c) then the function should return (a b c c b a)

2. Suppose you want to make a palindrome from a list = (x1 x2 … xn) that is an odd length and does not repeat xn, i.e. from the list (a b c) we want to make (a b c b a). Define a function to do this.

3. Define a LISP function to compute the hypotenuse of a right triangle and display it. You can use the sqrt function.

4. Write a LISP function that determines the length of a list and compares it to a number N. Specifically we should have two arguments, N and list, and the function should tell us if the length of the list is greater than N or less than or equal to N.

AttachmentSize
sample exam 2 solutions.html.txt33.07 KB