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
Is(are) input value(s) to use with a program to test the accuracy of the output.
Law Incorporation [45]

Answer:

test cases

Explanation:

5 0
3 years ago
Read 2 more answers
As data travels further over a wavelength or frequency, what goes down?
LUCKY_DIMON [66]

As data travels further over a wavelength or frequency, the radiation type goes down.

<h3>What is an electromagnetic spectrum?</h3>

An electromagnetic spectrum can be defined as a range of frequencies and wavelengths into which an electromagnetic wave is distributed into.

In Science, the electromagnetic spectrum consist of the following types of energy from highest to lowest frequency and shortest to longest wavelength:

  • Gamma rays
  • X-rays
  • Ultraviolet radiation
  • Visible light
  • Infrared radiation
  • Microwaves
  • Radio waves

In this context, we can infer and logically deduce that as data travels further over a wavelength or frequency within the electromagnetic spectrum, the radiation type goes down.

Read more on electromagnetic spectrum here: brainly.com/question/23423065

#SPJ1

5 0
1 year ago
"What is the concept of a computer implemented as part of a larger system that is typically designed around a limited set of spe
FrozenT [24]

Answer: Embedded system

Explanation:The combination of the hardware system along with software system to perform a particular function or task is known as the embedded system. It is a specific performance device which does its working on the basis of the microcontrollers as well as microprocessors .It performs the task according to the programs that are invoked in it to do the task in a larger device.

Example:- Printers performs specific task of printing and scanning

7 0
3 years ago
Make absolutely no changes to main(). Change function backwards so that the elements of the array are swapped in order for eleme
makkiz [27]

Answer:

i got you hold on.

Explanation:

5 0
2 years ago
Which of the following method calls are legal?a. mathMethod(x);b. mathMethod(y);c. mathMethod(x, y);d. mathMethod(x + y);e. math
Roman55 [17]

Answer:

Option a, b, d, f, and j is legal method calls.

Explanation:

In the given question some information is missing, that is the method definition which can be described as follows:

Method definition:

int x =2, y=3; //defining integer variable

int mathMethod (int x)  //method definition

{//method body

int z=x+y; //calculate value

return z;  //return value

}

In the given question option a, b, d, f, and j  is legal, because these options follow the correct syntax, and other option were incorrect which can be defined as follows:

  • In option c, It is illegal because it accepts only one parameter.
  • In option e, It is accepts long number, that's why it is illegal.
  • In option g, It accepts float value, that's why it is illegal.
  • In option h, It doesn't accepts any parameter.
  • In option i, It isn't use in method.
7 0
3 years ago
Other questions:
  • When programming, the word "execute" means which of these?
    13·1 answer
  • When a range of IP addresses is set aside for client devices, and one of these IPs is issued to these devices when they request
    14·1 answer
  • Write a function addOne that adds 1 to its integer referenceparameter. The function returns nothing.
    11·1 answer
  • What do character formats do for your document's message? A. Set how text aligns within a document B. Provide organization C. Pr
    6·2 answers
  • When projecting a presentation on a large screen, what should your minimum font size be?
    6·2 answers
  • Does clicking ads and pop ups like the one shown in this image could expose your computer to malware?
    15·1 answer
  • Write a C++ programthat returns the type of a triangle (scalene, equilateral,or
    12·1 answer
  • The function of network switch is to _____.
    5·1 answer
  • Does anyone know how to change your username? plz help I don't want my name on this lmo
    8·2 answers
  • Please Help!
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!