Question: The programming environment is PROCESSING from processing.org In mathematics the Fibonacci numbers are the numbers in the following sequence, which show every number in it

The programming environment is PROCESSING from processing.org

In mathematics the Fibonacci numbers are the numbers in the following sequence, which show every number in it is the sum of the two preceding ones.

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,

In mathematical terms, the sequence Fn of Fibonacci is defined by: Fn = Fn-1 + Fn-2

Note: The first two items are supposed to be always 1.

What to Do:

In this section you should write a Processing program that:

Prompts the user to enter a positive integer number greater than or equal 3, for n.

If n is less than 3, the program asks repeatedly until user enters a positive number greater than or equal 3.

Then the program continues and uses a loop to display the Fibonacci series ranging between 1 and n in the console area, using print function. For example, if user enters 9, it prints:

1, 1, 2, 3, 5, 8

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!