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));
}
}
This is in fact false to my knowledge
A PCM system consists of a PCM encoder (transmitter) and a PCM decoder (receiver). The essential operations in the PCM transmitter are sampling, quantizing and encoding. All the operations are usually performed in the same circuit called as analog-to digital convert Early electrical communications started to sample signals in order to multiplex samples from multiple telegraphy sources and to convey them over a single telegraph cable. The American inventor Moses G. Farmer conveyed telegraph time-division multiplexing (TDM) as early as 1853. Electrical engineer W. M. Miner, in 1903, used an electro-mechanical commutator for time-division multiplexing multiple telegraph signals; he also applied this technology to telephony.
Converting a decimal number into binary would be:
192/2= 96 remainder=0
96/2= 48 remainder=0
48/2=24 remainder=0
24/2=12 remainder=0
12/2=6 remainder=0
6/2=3 remainder=0
3/2=1 remainder=1
1/2= 0 remainder=1
The binary number would be: 11 00 00 00
For 16
16/2=8 remainder=0
8/2=4 remainder=0
4/2=2 remainder=0
2/2=1 remainder=0
1/2= 0 remainder=1
The binary would be: 00 01 00 00
For 3
3/2=1 remainder=1
1/2= 0 remainder=1
The binary would be: 00 00 00 11
For 1
1/2= 0 remainder=1
The binary would be: 00 00 00 01
The binary number would be:
11000000.00010000.00000011.00000001