CMPU-101, Spring 2013 Lab 5 Instructions The functions you will write for this lab are all recursive. You can choose to write them using either of the recursive techniques we have seen, regular recursion or accumulator-style recursion. PROBLEM 1. Define a recursive function, COUNT-STRINGS, that takes a list of any valid Racket type (lox) as its only input. It should return the number of strings contained in the input list, as shown below. > (count-strings (list "I" 1 "myself" 2 #t 4 '() "me")) 3 > (count-strings (list "a" "b" "c" "d" "e")) 5 > (count-strings (list 1 2 #t #f '() '())) 0 > (count-strings empty) 0 PROBLEM 2. Define a recursive function, FIRST-NUMBER, that takes a list of anything (lox) as its only input. It should return the first number in that list or, if the list does not contain any numbers, it should return #f, as shown below. > (first-number (list #t 2 3 '())) 2 > (first-number (list #t #f "hello")) #f > (first-number empty) #f PROBLEM 3. Define a recursive function, PRINT-NUMERIC that takes a list of anything (lox) as its only input. It should not return any output. Instead, it should print out the elements of that list as follows: - Numbers should be printed out as is. - Any other type should be replaced by the string "NaN" (i.e., "not a number"), as illustrated below. - At the end of the recursion, the function should print a newline. Be sure to include a space between each item printed as shown in the example invocations below. > (print-numeric (list 1 2 "x" #t '() 3 4)) 1 2 NaN NaN NaN 3 4 > (print-numeric (list #f 432 6 "y")) NaN 432 6 NaN > (print-numeric empty) Since the output of this function is void and only side-effect printing occurs, no pre-function tests are possible. For the post-function printf statements, the return type of this function will be # but the function should also have a printing side effect. Make sure you are checked off for this lab and submit your lab5 directory before leaving the lab.