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]
4 years ago
13

PLS HELP ME I HAVE NO TIME

Computers and Technology
1 answer:
melisa1 [442]4 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
What is the need for using secondary memory devices?
Savatey [412]
Hi pupil here's your answer ::


➡➡➡➡➡➡➡➡➡➡➡➡➡

They are needed because of the following reasons :

》The storage capacity of primary memory is limited.

》 Primary memory (RAM) is volatile in nature.

》 RAM is not portable memory.

》 RAM chips are expensive. Increasing RAM will increase the price of the computer.

So, for the above reasons we need to use the Secondary memory devices.

⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅


Hope this helps . . . . .
7 0
3 years ago
All of the following are forms of verbal communication except
Radda [10]
B. hand gestures
these are not verbal.
4 0
3 years ago
Read 2 more answers
Which type of element is , and what is the meaning of that element?
Korvikt [17]
Black #1 I wanna say
5 0
3 years ago
which server edition doesn't support any server roles that you would typically use with standard version
ioda

On the standard version of Microsoft Windows, Dynamic Host Configuration Protocol Server and Hyper-V Remote Access are two roles that aren't supported on Azure Virtual Machines - a type of server.

<h3>What is a Server?</h3>

It is to be noted that this is a computer device (hardware) or virtual environment (software) that feeds another computer with special services.

<h3>Type of Server</h3>

The following are various types of servers:

  • Webserver
  • Proxy Server
  • Virtual Machine (VM)
  • Database Server
  • Mail Server

See the link below for more about Servers:

brainly.com/question/25435769

8 0
3 years ago
The ____ statement can be used to eliminate the use of certain (flag) variables.
Juli2301 [7.4K]

The break statement can be used to eliminate the use of certain (flag) variables.

<h3>What is break statement?</h3>

A break statement is used to terminate the execution of the nearest enclosing for, do, switch, or while statement in which it appears.

The main purpose of break statement is to destroy the loop as soon as possible. For example if the given code asks a use input a integer number x. If x is divisible by 5, the break statement is executed and this causes the exit from the loop.

The advantage of break statement is it stops the case testing inside the block and break may be used within loops to alter control flow.

Therefore, the break statement can be used to eliminate the use of certain (flag) variables.

Learn more break statement here:

brainly.com/question/15082759

#SPJ4

8 0
2 years ago
Other questions:
  • If the value of the expression,
    13·1 answer
  • How to see if your computer has bluetooth?
    6·1 answer
  • A ___________ lists all possible packet switches and gives a next hop for each.
    12·1 answer
  • What is a file that has an .iso extension? What does this extension indicate?
    8·1 answer
  • Motivation is best defined as
    9·2 answers
  • Gary lives in an area that receives a lot of rain throughout the year. which device would be useful to him to maintain his compu
    8·1 answer
  • Write down a pair of integers whose sum is​ 0
    5·1 answer
  • HELP ME PLEASEEEE
    8·1 answer
  • 1.1<br> What are three reasons why decision-making is required in a programmed work cyde?
    10·1 answer
  • How can edge computing be used to increase sustainability
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!