I know the following sound a homework problem but it not it a study guild I to study but i am stuck. I really need help. I dont want to fail the test tomorrow

The following C code defines Fibonacci function

int fib (int n)
{
   if  (n == 0) return 0;
   else if (n == 1) return 1;
   else
    return (fib(n-1) + fib(n-2));
}

Define Fibonacci function in Scheme. Use fib as a function name

What does the following Scheme function do? Explain your answer.

(DEFINE (guesslis)
    (COND 
        ((NULL? lis) '())
            (ELSE (append(guess(CDR lis)) (LIST(CAR lis))))

What is the result of (guess ‘(A B C))? Show the derivation process

Scheme is basically Lisp. Sounds like you need to do some more study here. This may not be school work, but it looks a lot like homework for a course you are taking, even if an online one. Do you know how to write a recursive Scheme function? That is what you need to do for the fib() function.

since my teacher didnt give the number for fib what number am i using?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.