Student Center
|
Instructor Center
|
Information Center
|
Home
Sample Code
Choose a Chapter
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
Chapter 17
Multiple Choice Quiz
True or False
E-Lectures
Feedback
Help Center
Programming the Web Using XHTML and JavaScript
Larry Randles Lagerstrom
Loops and Arrays
True or False
1
The statement for (var k = 1; k < MAX; k++) may be written using commas:
for (var k = 1, k < MAX, k++)
A)
TRUE
B)
FALSE
2
In the statement for (var k = 1; k < MAX; k = k + 1){alert(k) } the call to alert is executed once before k = k + 1 is ever executed.
A)
TRUE
B)
FALSE
3
The statement for (var k = 1; k < MAX; k++){ alert(k)} may be written: for (var k = 1, k < MAX, k++) alert(k)
A)
TRUE
B)
FALSE
4
The statement for (var k = 1; k < MAX; k++){ alert(k)} may be written: for (k = 1, k < MAX, k++) alert(k)
A)
TRUE
B)
FALSE
5
for (var k = 10; k >= 5; k++){alert(k) } is an infinite loop
A)
TRUE
B)
FALSE
6
It's good practice to never change the value of a for loop's counter variable inside the loop
A)
TRUE
B)
FALSE
7
The do-3 loop executes the statements in its body exactly 3 times
A)
TRUE
B)
FALSE
8
Suppose a web page includes a form named f with a set of radio buttons named sodaBttns. Then document.f.sodaBttns is the name of an array.
A)
TRUE
B)
FALSE
9
Given the declaration var a = new Array(5) the statement a[5] = 37 is an error
A)
TRUE
B)
FALSE
10
Given the declaration var a = new Array(5) the last element of the array is a[5].
A)
TRUE
B)
FALSE
2003 McGraw-Hill Higher Education
Any use is subject to the
Terms of Use
and
Privacy Policy
.
McGraw-Hill Higher Education
is one of the many fine businesses of
The McGraw-Hill Companies
.