Question: Create the following Lisp functions. (Turn in a single script file that can be loaded to implement each of these functions.) 1) large_atom : largest

Create the following Lisp functions. (Turn in a single script file that can be loaded to implement each of these functions.)

1) large_atom: largest should return the largest value greater than 0 in the list at any level of lists of integers. It should return 0 if the list is empty.

Example: (large_atom ((1 2) 3 ( 2 3 (1 9)))) --> 9

2) biggerthan: biggerthan should return a list where all the integers are bigger than the input integer. Assume lists are a single level of atoms.

Example: (biggerthan 3 (1 2 3 4 5)) --> ( 4 5 )

4) evenprod : evenprod should return the product of all the even integers in a list.

Example: (evenprod (1 2 3 4 5)) --> 8 because 2 * 4 = 8

Note: an empty list returns 1

5) findname : Given a list of employee lists return the name of the employee with a particular id.

Employee list format ( name id age)

Example: (findname 3 ((bill 2 34) (mary 3 33) (frank 5 53))) --> mary

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!