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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started