CSC244 / CSC444 - Assignment #1 - Part 1 DUE: 5PM, Tuesday, September 19th, 2006 TURNIN: Please email the following to ardis@cs.rochester.edu : + 1 LISP file (a1.lisp) containing all function and structure definitions used to solve the assignment problems. + 1 text file (a1_usage.txt) containing a text log of using your defined functions/structures to solve the assignment problems. For example: > (funcall fibonacci 1) 1 > (funcall fibonacci 2) 1 > (funcall fibonacci 3) 2 Please include all code usage which you believe helps show the correct behavior of your provided LISP code. + 1 text file (a1_readme.txt) containing a brief description of all defined functions/structures including their intended purpose, input/output, etc. Please indicate here if your code has any problems/incapatabilities/failures, as well as any improvements for efficiency or robustness, for purposes of partial credit and/or extra credit. Your email should have the subject line "CSC244 Assignment 1" if you are in CSC244 and "CSC444 Assignment 1" if you are in CSC444. Multiple submissions are allowed, but only the most recent submission (prior to the deadline) will be graded. Please put your name at the top of your submission email. Late submissions will be accepted for 2 days with a 10% penalty per day. All submissions after September 21st will not be graded. PROBLEMS: These problems should provide you with a good introduction to LISP as a language, as well as challenging you to think about problems in a manner which can be easily expressed in LISP. 1.) Create a function "multlist" which takes as inputs an integer number A and a list of integers B, and returns a list which is the result of multiplying A by each of B's elements. If the input is not of the correct format (A is not a single integer or B is not a list), print "ERROR: Incorrect input" and return -1; For example: > (funcall multlist 3 '(1 2 3)) (3 6 9) > (funcall multlist 2 '(7 4)) (14 8) > (funcall multlist 3 2) ERROR: Incorrect input 2.) Create a function "pascal" which takes as input a single integer number A and returns the corresponding level of Pascal's Triangle (which is also the list of coefficients of the binomial expansion of (x+1)^(A+1)). In case you have not dealt with Pascal's Triangle before, it is described here: http://en.wikipedia.org/wiki/Pascal%27s_triangle Expected results are as below: > (funcall pascal 2) (1 1) > (funcall pascal 4) (1 3 3 1) > (funcall pascal 6) (1 5 10 10 5 1) REMINDER: If you have any questions about the assignment, please email ardis@cs.rochester.edu or come to room 624 between 11 and 12 on Tuesday or Thursday.