Question: Write the following functions in LISP: (sumpositive L) which only adds positive numbers in a given list: (1.5 pt) (sumpositive (1-2 3 4 -5))

Write the following functions in LISP: (sumpositive L) which only adds positive

 

Write the following functions in LISP: (sumpositive L) which only adds positive numbers in a given list: (1.5 pt) (sumpositive (1-2 3 4 -5)) 8 Answer: (multiplylists L1 L2) which takes elements from two lists one by one and multiplies them: (1.5 pt) (multiplylists (123) (4 5 6)) (4 10 18) Answer: (addinorder x L) which inserts in order a number x into an ordered list L: (1.5 pt) (addinorder 3 (1 2 4 5)) (12345) Answer: (removeparentheses L) which removes all inner parentheses from a list L: (1.5 pt) (removeparentheses (1 (2 3) (4 (5)))) (12345) Answer: (makepairs L) which makes an inner list with every two successive numbers: (1.5 pt) (makepairs (1 2 3 4 5 6) ((1 2) (34) (56)) (makepairs (1234567) ((1 2) (34) (56) (7)) Answer:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here are the functions implemented in LISP 1 sumpositive L This function adds only positive numbers ... View full answer

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 Programming Questions!