1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
s344n2d4d5 [400]
3 years ago
13

PLS HELP ME I HAVE NO TIME

Computers and Technology
1 answer:
melisa1 [442]3 years ago
6 0
Please Help! Unit 6: Lesson 1 - Coding Activity 2
Instructions: Hemachandra numbers (more commonly known as Fibonacci numbers) are found by starting with two numbers then finding the next number by adding the previous two numbers together. The most common starting numbers are 0 and 1 giving the numbers 0, 1, 1, 2, 3, 5...
The main method from this class contains code which is intended to fill an array of length 10 with these Hemachandra numbers, then print the value of the number in the array at the index entered by the user. For example if the user inputs 3 then the program should output 2, while if the user inputs 6 then the program should output 8. Debug this code so it works as intended.

The Code Given:

import java.util.Scanner;

public class U6_L1_Activity_Two{
public static void main(String[] args){
int[h] = new int[10];
0 = h[0];
1 = h[1];
h[2] = h[0] + h[1];
h[3] = h[1] + h[2];
h[4] = h[2] + h[3];
h[5] = h[3] + h[4];
h[6] = h[4] + h[5];
h[7] = h[5] + h[6];
h[8] = h[6] + h[7]
h[9] = h[7] + h[8];
h[10] = h[8] + h[9];
Scanner scan = new Scanner(System.in);
int i = scan.nextInt();
if (i >= 0 && i < 10)
System.out.println(h(i));
}
}
You might be interested in
The _____ search algorithm searches a list for a given item, starting with the first element and continues to compare the item w
noname [10]

Answer:

Sequential

Explanation:

Based on the information provided within the question it can be said that the search algorithm that is being described in this scenario is a Sequential algorithm. This is because sequential programming focuses on programming (or in this case searching for) a result by doing one step at a time as opposed to various functions running simultaneously.

7 0
3 years ago
Impacto que ha tenido en la sociedad la educacion virtual​
iVinArrow [24]

Answer:

ʜᴏʟᴀ ɪᴅɪᴏᴛᴀ

ᴄᴏᴍᴏ ᴇsᴛᴀs

ᴇsᴛᴜᴘɪᴅᴏ

7 0
3 years ago
What is the Multiple Source Test
Goshia [24]
A source is where you can look to find info. Multiple means many or some. 

Therefore, a multiple source test is a test that you can find the answers in multiple sources, such as a book, article, journal, etc. 
7 0
3 years ago
Read 2 more answers
How do you create an external Stylesheet in BlueGriffon
Sever21 [200]
Go to panel and select stylesheet. Hope this helped:)
5 0
3 years ago
Which of the following software is an
krok68 [10]
The answer is B:McAfee
3 0
2 years ago
Read 2 more answers
Other questions:
  • Which is true for a hosted blog software
    15·2 answers
  • Which of these computers was marketed as a computer/game machine?
    15·2 answers
  • . Given an initially empty stack s that accepts integers, the following operations are performed: s.push (10) s.push (20) s.push
    13·1 answer
  • What is the purpose for adding images and graphics to a web page?
    5·1 answer
  • Write a function maxTemp which takes a filename as string argument and returns the maximum temperature as float type for the wee
    13·1 answer
  • Suppose that the instruction format for a modified Little Man Computer requires two consecutive locations for each instruction.
    5·1 answer
  • If 209g of ethanol are used up in a combustion process, calculator the volume of oxygen used for the combustion at stp​
    5·1 answer
  • Types of Computer games​
    6·1 answer
  • Which subscription service complements App-ID by enabling you to configure the next-generation firewall to identify and control
    6·1 answer
  • Compare and discuss between electromechanical and electronic era of computer​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!