okay here is what i got.
try restarting your wifi router and if that doesn't work then restart the console.
other than that i got nothing
hope this helps.
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));
}
}
There is no technical reason for using one or the other, a computer could easily handle both variants.
The reason for hex is that it is so much more intuitive and practical to use. It is quicker to write, because it requires fewer characters. With bits, you would be very likely to miss count at some point and also wouldn't notice typos, because who actually remembers all 24 characters. The length also makes it harder to read: where does the green channel start/where is the 9th character?
Additionally, hex numbers are closer to the typical decimal system, only adding 6 symbols, while with binary you remove 8 symbols, which makes it a bit more familiar and easier to learn.
Answer:
system has two symbols: 0 and 1 , called bits. ... 0011 0100 0011 0001 1101 0001 1000 B , which is the same as hexadecimal B343 1D18H ) ... Example 1: Suppose that n=8 and the binary pattern is 0100 0001 B , the value of this unsigned integer is 1×2^0 ... An n-bit pattern can represent 2^n distinct integers.
Explanation: