Question: Problem 1 Write a LISP function in DrRacket to determine if all the elements in a given list are numbers only. The list has no

Problem 1

Write a LISP function in DrRacket to determine if all the elements in a given list are numbers only. The list has no embedded lists and is only a list of depth. The function return T if the list only contains numbers and F false if any item is a none number.

(allnums '(1 4 2 9 5 12)=T

(allnums '(1 2 3 a b c 4 5 6) = F

(allnums '()) = F

(allnums '(7)) =T

(allnums '(x)) =F

Problem 2

Write a LISP function that will determube if a list of numbers is in creasing order from smallest to largest. The list hsould be only numbers and no embedded lists are included. The function return T if the list is increasing and F false if the numbers are not increasing or not all numbers. There must be at least two numbers to compare.

(increasing '(1 a 2 b 3 c))=F

(increasing '(1 4 7 8 9 11 21))=T

(increasing '(3 6 7 1 9 11))=F

(increasing '(2 3 3 5 8 9))=F

(increasing '(1))=F

(incerasing '(a b c))=F

(increasing '())=F

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!