McGraw-Hill OnlineMcGraw-Hill Higher EducationLearning Center
Student Center | Instructor Center | Information Center | Home
Sample Code
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




McGraw-Hill/Irwin