Deck 20: Iteration Principles

ملء الشاشة (f)
exit full mode
سؤال
The control specification of the for loop includes three operations: <initialization>, <continuation>, and <next iteration> .
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
A for loop continues as long as the <continuation> test is true .
سؤال
The starting point for a for loop is always 0 .
سؤال
The step size of a for loop is always 1 .
سؤال
Loops cannot count backwards .
سؤال
Iteration variables must always be single letter identifiers .
سؤال
The iteration variable is often used in computations in the <statement list> .
سؤال
Iteration variables should be declared with the keyword iter instead of var because they are special variables .
سؤال
All for loops should have a <continuation> test .
سؤال
The <continuation> operation of a for loop has the same form as the predicate in a conditional statement .
سؤال
You can put a loop inside another loop .
سؤال
You cannot put a conditional statement inside a loop .
سؤال
An array index must be a non-negative integer .
سؤال
The off-by-one error is an uncommon error in computing .
سؤال
Image prefetching can be performed at any time prior to the start of the associated animation .
سؤال
If the loop initialization of a for loop makes the continuation test false, the loop body will only execute once .
سؤال
A World-Famous Iteration (WFI) loop which has n iterations generates exactly all the legal subscripts for an array of size n .
سؤال
Anything you can do by modifying the DOM could also be done with the document . write() function .
سؤال
Timers can be set but not canceled .
سؤال
Which of the following controls the number of iterations of a for loop?

A) function
B) iteration variable
C) incrementization
D) initialization
سؤال
How many iterations will occur in the following loop?
For (again = 0; again < 5; again++) { . . . . }

A) six
B) five
C) four
D) cannot tell
سؤال
For the elements of an array to store images, they must each be initialized to a(n)

A) prefetch object
B) src object
C) gifpix object
D) image object
سؤال
Which of the following will create a loop that will iterate ten times?

A) for (i = 0; i <=10; i = i + 1)
B) for (i = 1; i < 10; i = i + 1)
C) for (i = 0; i <10; i = i + 1)
D) None of these
سؤال
Which of the following is an infinite loop?

A) for (k = 1; k <= 4; k = k + 1)
B) for (k = 1; k < 3; k = k + 1)
C) for (k = 0; k <= 10; k = k + 1)
D) for (k = 1; k <= 4; k = k - 1)
سؤال
Which of the following is the correct code for the step size of the loop shown to ensure that the loop will repeat exactly five times?
For ( c = 3; c < 13; ________)

A) c = c + 2
B) c++
C) c = c + 3
D) c = c + 4
سؤال
Which of the following is the correct way to declare an array named myArray with ten elements?

A) var myArray = new(10);
B) myArray = new var(10);
C) var myArray = new Array(10);
D) new myArray = Array(10);
سؤال
Which of the following is the standard form for the World-Famous Iteration?

A) for (i = 0; i <= n; i++) { . . . }
B) for (i = 1; i < n; i++) { . . . }
C) for (i = 0; i < n; i++) { . . . }
D) None of these
سؤال
Which of the following statements is TRUE about the following JavaScript declaration?var rows = new Array(5);

A) The array will have six items .
B) The first item in the array will be rows[0] .
C) The last item in the array will be rows[5] .
D) All of these are true .
سؤال
In a for loop, the operation that sets the variable's value for the first iteration of the loop is the

A) initialization
B) test
C) condition
D) iteration
سؤال
The clearTimeout() function is used to

A) restart the timer
B) reset the interval of the timer
C) cancel the timer
D) reset the number of times the timer runs
سؤال
If you have a nested loop structure where the outside loop runs five times and the inside loops runs seven times, the statements of the inside loop will be executed ________ times .

A) seven
B) five
C) twelve
D) thirty-five
سؤال
On a web page, images can be loaded and stored in a(n)

A) image array
B) form load
C) image object
D) pic array
سؤال
Given the following JavaScript code, which of the following is the handle?
TimerID = setTimeout("animate()", 30);
ClearTimeout(timerID);

A) setTimeout()
B) clearTimeout()
C) clearTimeout(timerID)
D) timerID
سؤال
Given the following JavaScript code, which of the following is the event handler?
TimerID = setTimeout("animate()", 30);
ClearTimeout(timerID);

A) setTimeout()
B) animate()
C) setTimeout(animate())
D) timerID
سؤال
In programming ________ means looping through a series of statements to repeat them .
سؤال
The proper programming term for <continuation> is ________ test because it checks to see if the loop should terminate .
سؤال
The ________ size is the amount that an iteration variable is changed after each cycle of a for loop .
سؤال
In JavaScript '\n' is the ________ symbol .
سؤال
The point at which array indexing begins (the least index) is the index ________ .
سؤال
The index origin in JavaScript is ________ .
سؤال
A(n) ________ is an indexed base name .
سؤال
An array index is also called a(n) ________ .
سؤال
In animation, one of many images that is rapidly redrawn to create the illusion of motion is known as a(n) ________ .
سؤال
In JavaScript, i++ is an example of ________ notation and means the same as i = i + 1 .
سؤال
Loading images ahead of time is called ________ .
سؤال
The number of elements in an array is referred to as the array ________ .
سؤال
A(n) ________ is the common name for the repetition of a block of programming code .
سؤال
A(n) ________ is the single still image in a series of rapidly moving still images .
سؤال
In JavaScript, timers ________ a thousand times per second .
سؤال
If myArray is an array of length 10, the largest subscript is ________ .
سؤال
A JavaScript program can change the content of a page that is already displayed by changing the ________ .
سؤال
The timed event code that displays an animation must update the displayed frame and finally set the ________ so the next frame will be displayed .
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/52
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 20: Iteration Principles
1
The control specification of the for loop includes three operations: <initialization>, <continuation>, and <next iteration> .
True
2
A for loop continues as long as the <continuation> test is true .
True
3
The starting point for a for loop is always 0 .
False
4
The step size of a for loop is always 1 .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
5
Loops cannot count backwards .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
6
Iteration variables must always be single letter identifiers .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
7
The iteration variable is often used in computations in the <statement list> .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
8
Iteration variables should be declared with the keyword iter instead of var because they are special variables .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
9
All for loops should have a <continuation> test .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
10
The <continuation> operation of a for loop has the same form as the predicate in a conditional statement .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
11
You can put a loop inside another loop .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
12
You cannot put a conditional statement inside a loop .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
13
An array index must be a non-negative integer .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
14
The off-by-one error is an uncommon error in computing .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
15
Image prefetching can be performed at any time prior to the start of the associated animation .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
16
If the loop initialization of a for loop makes the continuation test false, the loop body will only execute once .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
17
A World-Famous Iteration (WFI) loop which has n iterations generates exactly all the legal subscripts for an array of size n .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
18
Anything you can do by modifying the DOM could also be done with the document . write() function .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
19
Timers can be set but not canceled .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following controls the number of iterations of a for loop?

A) function
B) iteration variable
C) incrementization
D) initialization
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
21
How many iterations will occur in the following loop?
For (again = 0; again < 5; again++) { . . . . }

A) six
B) five
C) four
D) cannot tell
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
22
For the elements of an array to store images, they must each be initialized to a(n)

A) prefetch object
B) src object
C) gifpix object
D) image object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which of the following will create a loop that will iterate ten times?

A) for (i = 0; i <=10; i = i + 1)
B) for (i = 1; i < 10; i = i + 1)
C) for (i = 0; i <10; i = i + 1)
D) None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which of the following is an infinite loop?

A) for (k = 1; k <= 4; k = k + 1)
B) for (k = 1; k < 3; k = k + 1)
C) for (k = 0; k <= 10; k = k + 1)
D) for (k = 1; k <= 4; k = k - 1)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
25
Which of the following is the correct code for the step size of the loop shown to ensure that the loop will repeat exactly five times?
For ( c = 3; c < 13; ________)

A) c = c + 2
B) c++
C) c = c + 3
D) c = c + 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
26
Which of the following is the correct way to declare an array named myArray with ten elements?

A) var myArray = new(10);
B) myArray = new var(10);
C) var myArray = new Array(10);
D) new myArray = Array(10);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which of the following is the standard form for the World-Famous Iteration?

A) for (i = 0; i <= n; i++) { . . . }
B) for (i = 1; i < n; i++) { . . . }
C) for (i = 0; i < n; i++) { . . . }
D) None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
28
Which of the following statements is TRUE about the following JavaScript declaration?var rows = new Array(5);

A) The array will have six items .
B) The first item in the array will be rows[0] .
C) The last item in the array will be rows[5] .
D) All of these are true .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
29
In a for loop, the operation that sets the variable's value for the first iteration of the loop is the

A) initialization
B) test
C) condition
D) iteration
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
30
The clearTimeout() function is used to

A) restart the timer
B) reset the interval of the timer
C) cancel the timer
D) reset the number of times the timer runs
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
31
If you have a nested loop structure where the outside loop runs five times and the inside loops runs seven times, the statements of the inside loop will be executed ________ times .

A) seven
B) five
C) twelve
D) thirty-five
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
32
On a web page, images can be loaded and stored in a(n)

A) image array
B) form load
C) image object
D) pic array
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
33
Given the following JavaScript code, which of the following is the handle?
TimerID = setTimeout("animate()", 30);
ClearTimeout(timerID);

A) setTimeout()
B) clearTimeout()
C) clearTimeout(timerID)
D) timerID
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
34
Given the following JavaScript code, which of the following is the event handler?
TimerID = setTimeout("animate()", 30);
ClearTimeout(timerID);

A) setTimeout()
B) animate()
C) setTimeout(animate())
D) timerID
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
35
In programming ________ means looping through a series of statements to repeat them .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
36
The proper programming term for <continuation> is ________ test because it checks to see if the loop should terminate .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
37
The ________ size is the amount that an iteration variable is changed after each cycle of a for loop .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
38
In JavaScript '\n' is the ________ symbol .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
39
The point at which array indexing begins (the least index) is the index ________ .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
40
The index origin in JavaScript is ________ .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
41
A(n) ________ is an indexed base name .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
42
An array index is also called a(n) ________ .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
43
In animation, one of many images that is rapidly redrawn to create the illusion of motion is known as a(n) ________ .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
44
In JavaScript, i++ is an example of ________ notation and means the same as i = i + 1 .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
45
Loading images ahead of time is called ________ .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
46
The number of elements in an array is referred to as the array ________ .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
47
A(n) ________ is the common name for the repetition of a block of programming code .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
48
A(n) ________ is the single still image in a series of rapidly moving still images .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
49
In JavaScript, timers ________ a thousand times per second .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
50
If myArray is an array of length 10, the largest subscript is ________ .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
51
A JavaScript program can change the content of a page that is already displayed by changing the ________ .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
52
The timed event code that displays an animation must update the displayed frame and finally set the ________ so the next frame will be displayed .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 52 في هذه المجموعة.