- What is wrong with the following function? It is supposed to
find and return the value of the largest integer in an array of
integers. (There may be more than one problem with this function.
Describe all errors that you find. Also,
the errors are all logic errors - all of the statements are legal
var largest = array;
for (var i = 0; i< array.length; i++)
if (largest > array[i])
largest = i;
- How many times will the statement
doSomething(); be executed in the following loop?
for (var i = 0; i < 6; i = i + 2)
for (var j = 0; j <= 4; j++)
How many different numbers can be represented with 13 binary digits? How many different numbers can be represented with 3 hexadecimal digits?
- How is the decimal number 63 represented in
- What are the decimal representations of
Show some work for exercises 4 and 5 so that I can see how you
reached your answers.
- the binary number 1001101 ?
- the hexadecimal number B9 ?
The following is a binary representation of an ASCII encoded string.
Each eight-bit byte represents one character. (This is actually
UTF-8, a superset of ASCII. ASCII itself uses a 7-bit encoding.)
Decode the string. If you use any outside tools, reference them in