Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1- There is a well-known mathematical sequence called the Fibonacci series. Starting with 0 and 1 as seed values, each successive number is equal to

1-

There is a well-known mathematical sequence called the Fibonacci series. Starting with 0 and 1 as seed values, each successive number is equal to the sum of the previous two numbers. Therefore the Fibonacci series looks like:

0, 1, 1, 2, 3, 5, 8, 13,

Note that the value of the fourth Fibonacci number, F(4) = F(3) + F(2)

Generalized, we can say that F(n) = F(n-1) + F(n-2) for all n > 2

Write an algorithm to get a number which is greater than 0, then calculate and print the Fibonacci value for that number. Remember that the computing agent can enter any value > 0, including 1 or 2.

___________________________________________________________________________________

2- Write an algorithm to determine for a list of characters whether or not it forms a palindrome (spelled the same either forward or backward). For example RADAR is a palindrome. Assume that only upper-case letters are used. Write an algorithm to get the characters, conduct the palindrome test, and output the result Yes it is a palindrome or No it is not a palindrome.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions