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
mapa mental con la explicación de que medios de comunicación y redes sociales intervienen en la construcción de tu identidad​
lisov135 [29]

Answer:

este presente yo cuando me pidieron eso

5 0
3 years ago
Countries need to engage in trade of natural resources because of distribution in the earth. For instance, countries such as Sau
maks197457 [2]
Water is a scarcity in this area
4 0
3 years ago
Darian is preparing for a presentation about the poor condition of the locker rooms at school. Match each of the key components
Gemiola [76]

Answer:

Purpose - To paurswade the board to change the conditions of the locker room

Topic - Locker room condition

Method - Electronic Slideshow

Audience - School Board

7 0
2 years ago
Describe what Carmen should do in the following scenario.
Fudgin [204]

Answer:

...................USB?

8 0
3 years ago
Read 2 more answers
32.043 in expanded form
Andre45 [30]

What does expanding a number really mean? When we expand a number, we are showing the value of each digit in that number. For example, the number 521 has a total of 500 + 20 + 1. This number has been written in its expanded form by showing the value of each digit.

In the case of a decimal number above 32.043, we will write each number according to its place value. This will be done by multiplying each digit by its place value and then adding them together. In this case, 32.043 in its expanded form will be;

(3×10) + (2×1) + (0× 1/1000) + (4×1/100) + (3×1/10)

(30)+ (2) + (0.0) + (0.04) + (0.003)


7 0
3 years ago
Read 2 more answers
Other questions:
  • Using refracted laser light to store data on a photoreceptive substrate is essentially how ___ storage works. Theoretically this
    5·1 answer
  • Get these points why they hot!!!!!!!!!!!!!!!!!!!!
    14·2 answers
  • . Business-to-business integration (B2Bi) is vital for efficient and accurate flow of data across internal ISs and external busi
    11·1 answer
  • A corporation needs an operating system that allows the various teams in its office to network and collaborate on projects. Whic
    10·1 answer
  • Write the definition of a function named averager that receives a double parameter and returns-- as a double -- the average valu
    11·1 answer
  • What is the Matlab command to create a column vector with 11 equally spaced elements, whose first element is 2 and whose last is
    8·1 answer
  • How to open a new word proccessing document
    9·1 answer
  • What are the three basic classes of application
    14·2 answers
  • What do you understand by the term polysome?​
    14·1 answer
  • Please answer this simple (hard) question for me lol
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!