subject

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!

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Matlab question: use switch and anythe lottery game matches three different integer numbers between 1 and 10. winning depends on how many matching numbers are provided by a player. the player provides three different integers between 1 and 10.if there is a match of all 3 numbers, the winning $ 1000.if there is a match with 2 numbers, the winning $ 10.if there is a match of all with 1 numbers, the winning $ 1.with no match, the winning is $0.write a function lottery3 that checks three numbers provided by a player and determine the winning amount. if the user mistakenly enters same number twice/thrice and if that number matches one of the winning numbers, the code should count that number only once and display correct result. the player doesn’t have to guess the order of numbers.the input to the function lottery3 can have up to two input arguments. the first input argument is a row array numbers with 3 numbers. if the second argument input testcode is present, and is a row vector of 3 values, the function lottery3 uses the code in testcode as the three winning numbers (the test must be three different integer numbers between 1 and 10), else three different numbers will be automatically generated by testcode.the ouput should return the variable winnings and the three winning numbers in the row array winnumbers.hint: make use of the internal function any.restriction: the function must use switch-case statements to determine the winning.example #1: winning = lottery3( [1,2,1],[1,2,3])produceswinning =10example #2: [winning,winnumbers] = lottery3( [1,2,3])produceswinning =3winnumbers =8 5 3
Answers: 1
question
Computers and Technology, 24.06.2019 02:30
Which option completes the explanation for conflict of interest in an organization
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
question
Computers and Technology, 24.06.2019 08:00
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
Answers: 1
You know the right answer?
Java 40 points!
The Fibonacci sequence is the sequence of numbers:

0, 1, 1, 2, 3,...
Questions
question
Mathematics, 26.10.2021 22:00
question
Mathematics, 26.10.2021 22:00
question
Mathematics, 26.10.2021 22:00
question
Health, 26.10.2021 22:00
question
Spanish, 26.10.2021 22:00
question
Mathematics, 26.10.2021 22:00
Questions on the website: 13722361