Question: In .lisp Function 1: divisible-by-5 In CLISP define your own function that takes a single integer as an argument and returns a Boolean that indicates

In .lisp

Function 1: divisible-by-5

In CLISP define your own function that takes a single integer as an argument and returns a Boolean that indicates whether the number is divisible by 5. You do not have to perform error checking on the input.

Input: An integer

Output: A Boolean

Examples:

> (divisible-by-5 14)

#f

> (divisible-by-5 25)

#t

> (divisible-by-5 30)

#t

Function 3: fib

In CLISP define a function using recursion to compute the Fibonacci number of n (where n is a positive integer)

Fib(n) = 1 for n = 0 or n = 1

Fib(n) = Fib(n-1) + Fib(n-2) for n > 1

Input: A positive integer used to calculate a Fibonacci number

Output: The value returned given the input integer

Examples:

> (fib 1)

1

> (fib 5)

8

> (fib 10)

89

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!