Question: Please solve the same way it is solved in the question, in scheme prolog please. thanks 2. Define the following functions: a. (pad x )
Please solve the same way it is solved in the question, in scheme prolog please. thanks
2. Define the following functions: a. (pad x ) returns the list x in which each zero element is replaced by the previous non-zero element in the list. Any leading zeros will remain unchanged. Example: (pad ' (01004002) ) returns the list ( 01 b. (aprog x ) returns True if list x is an arithmetic progression and False otherwise first) can be Recall that an arithmetic progression is a sequence in which each elememt difference. obtained from the previous one by adding a fixed value called the common dif 3 ). Example: (aprog '(2 258111417 ) evaluates to True (the common difference here is ( 6 marks) (6 marks) Answer: ( debine (pad x ) (rond (mule? x ) (letx) (le(cosx)0) (log(cosx))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
