Computers and Technology

Java 40 points!
The Fibonacci sequence is the sequence of numbers:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …

The next number is found by adding up the two numbers before it.

For example, the 2 is found by adding the two numbers before it (1+1). The 3 is found by adding the two numbers before it (1+2). The 5 is found by adding the two numbers before it (2+3), and so on! Each number in the sequence is called a term.

In this exercise, you will need to:

Create the array int[] sequence that holds the values of the first 15 terms of the Fibonacci sequence. Think carefully about what happens to the index when iterating through the loop to fill this array. Read the Fibonacci description above to help!
Then print out the sequence of numbers separated by a space.
Finally, create a method findIndex to find the index of the term 55.
Sample output:

Fibonacci sequence up to 15 terms:
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377
Index position of 55 is: 10
Hint: You will need to use several loops: One to fill the array, one to print the array, and one to traverse the array!

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:10, Tatertotzzzz
Write a method that accepts a string object as an argument and returns the number of words it contains. for instance, if the argument is "four score and seven years ago", the method should return the number 6. demonstrate the method in a program that asks the user to input a string and then passes that string into the method, printing out whatever the method returns.
Answers: 3
image
Computers and Technology, 23.06.2019 00:50, AmbitiousAndProud
Representa os dados de um banco de dados como uma coleç? o de tabelas constituídas por um conjunto de atributos, que definem as propriedades ou características relevantes da entidade que representam. marque a alternativa que representa o modelo descrito no enunciado. escolha uma:
Answers: 3
image
Computers and Technology, 24.06.2019 22:00, rayne40
Is the process of organizing data to reduce redundancy. a. normalization b. primary keying c. specifying relationships d. duplication
Answers: 1
image
Computers and Technology, 25.06.2019 05:40, Juancr4539
How to make a negative number positive in excel
Answers: 3
Do you know the correct answer?
Java 40 points!
The Fibonacci sequence is the sequence of numbers:

0, 1, 1, 2, 3,...

Questions in other subjects:

Konu
Mathematics, 07.06.2021 21:00
Konu
Mathematics, 07.06.2021 21:00
Konu
English, 07.06.2021 21:00