Review Topics

Chapter 4

Chapter 6


  1. Create a form with a text box and a button.
  2. Make the button call the function handleClick when it is clicked.
  3. Make handleClick add one to the value in the text box.
  4. Add radio buttons to increment by 1, 5 or 10.
  5. Make the form increment by 1, 5 or 10.

1
5
10

Converting binary to dec and back

Binary to decimal
 101101
      ^--->1 * 2^0 = 1 
     ^---->0 * 2^1 = 0
    ^----->1 * 2^2 = 4
   ^------>1 * 2^3 = 8
  ^------->0 * 2^4 = 0
 ^-------->1 * 2^5 = 32
 
 Add them up to get decimal
 32 + 8 + 4 + 1 = 45
 
 00101101 is the same
 
 Decimal to binary:
 44
 
 Divide by 2. Keep track of quotient
 and remainder
 
 44/2
 Q      R
 22     0
 11     0
 5      1
 2      1
 1      0
 0      1
 
 Read remainders bottom to top
 101100
 
 Convert to HEX
 00101100
 
 Split into groups of four
 0010  1100
 2     C
 
 1100 = 8+4 = 12 -> C