CS451 Fall 2007 Assignment 1 Due September 6 (in class) ----------------------------------------------------------------- 1. Define a type called Person, which is a triple, consisting of the name of a Person, the age of the Person, and the name of the parent of the Person (assume ever person has just one parent). 2. Create a list of Persons called plist. (A global variable) 3. Write a function called age, which takes a Person, and returns the age of that Person. 4. Write a function called name, which takes a Person, and returns the name of that Person. You will need list comprehension for the following functions, and it is easier if you define a function using previous functions. 5. Write a function called nameChildren, which takes a Person and returns a list of the names of all the Children of that person. 6. Write a function called children, which takes a Person and returns a list of all the children of that Person. (You must return a list of Persons) 7. Write a function called over21, which takes a Person and returns a list of all the children of that Person who are over 21 years old. (Again, return a list of Persons) 8. Write a function called namesover21, which takes a Person and returns a list of the names of all the children of that Person who are over 21 years old. 9. Write a function called grandchildren, which takes a Person and returns a list of the names of all the grandchildren of that Person. For the following, you also need to use recursion. 10. Write a function called descendants, which takes a Person and returns a list of the names of all the descendants of that Person.