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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started