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
Two strategies for keeping your files in sync
zlopas [31]

Answer:

1. MS Cloud

2. G Drive

Explanation:

5 0
3 years ago
Which trait depicts honesty?
Aliun [14]

(B) reporting additional cash found in the cash register

5 0
3 years ago
Write a sentence that describes how a series circuit works.
Lorico [155]

Answer:

In a series connection, the current is the same through each component regardless of any kind of components are used or their values. The voltage drops across each component in the circuit are dependent upon the values of the components used in the circuit. Another way to view a series connection is that the positive end of each component is connected to the negative end of the previous component in a 'one after the other' arrangement. The negative end of each component is also connected to the positive end of the next component.

It is one of which every component is arranged in a series connection. Hence series circuit will have same current at all points of the circuit. The voltage drop across each component in the circuit adds up to sum of voltage source across each component and of an equivalent component value. Breaking of the series circuit will make entire circuit to stop working. Suppose consider the three bulbs are connected in series connection and if even one bulb burns out or broken then all the three bulbs will stop working as well. In series circuit components like current (I) is sum of all the element and Voltage is sum of all the voltage drops and resistance is the sum of individual resistances.

Explanation:

3 0
2 years ago
Warning or pop-up that convinces a user that his or her computer or mobile device is infected with a virus or other problem that
o-na [289]
Idk... just dont trust those pop-ups unless your device is acting weird.
3 0
3 years ago
Plzz help will mark brainliest
vlabodo [156]

Answer:

11. 3 dimensions

12. ( i believe its number 3)

13. 2 option

14. Natural Light

15. Development

Explanation:

7 0
3 years ago
Other questions:
  • Write an interactive Python calculator program. The program should allow the user to type a mathematical expression, and then pr
    13·1 answer
  • Please help with this
    5·2 answers
  • For a project called "The Sheep Market", Aaron Koblin collected drawings of sheep from strangers on the Internet. He posted the
    14·1 answer
  • Is it okay to leave your car running while parked?
    15·1 answer
  • This term describes two or more arrays that hold related data, and the related elements in each array are accessed with a common
    15·1 answer
  • Write the definition of a class clock. the class has no constructors and three instance variables. one is of type int called hou
    12·1 answer
  • WILL GIVE BRAINLIEST!!
    12·1 answer
  • Mention two strategies of collecting data​
    13·1 answer
  • susan wrote the recursive formula for the sequence represented by the exploit formula An=3+2n. put an C net to any correct state
    13·1 answer
  • In Python which is the correct method to load a module math?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!