Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use C++ (Fibonacci Series) A Fibonacci series is determined by its main property - each member of the series is equal to the sum if

Use C++ image text in transcribed
(Fibonacci Series) A Fibonacci series is determined by its main property - each member of the series is equal to the sum if it's two predecessors x = x_ - 2 + x_ - 1 (the first two members x_1, x_2 can be assigned arbitrarily. For example, in the classical Fibonacci series x_1 = x_2 = 1. One interesting property of a Fibonacci series is that the ratio of the values of adjacent members of the series approaches a number called "the golden ratio" or phi = 1.618 (this is a unique number, its powers phi , phi, phi^2, phi^3,... establish a Fibonacci series, so^Forall k greaterthanorequalto 2: phi = phi^k - 2 + phi^k - 1, and phi^-1 = tau = phi - 1 = 0.618 is commonly known as "the golden section"). Design a program that accepts the first two numbers of a Fibonacci series as user input and then generates additional values in the series until the ratio of adjacent values converges to within 0.001, which means that the process should be stopped when the following condition holds |x /x_k - 1 - x_k - 1/x_k - 2| lessthanorequalto 0.001, where x_1, x_2, x_3,... x_t - 2, x_ - 1, x_k,... is a Fibonacci series. You should store all members generated in an array and then print out at the console window the number (quantity) of the series members generated out all members generated (you should print then from the array). Use a while loop with a logical condition opposite to the one defined by the condition above

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

7. What traps should she avoid?

Answered: 1 week ago

Question

5. What decision-making model would you advocate to this person?

Answered: 1 week ago

Question

6. What data will she need?

Answered: 1 week ago