Deck 8: Javascript: Control Statements II

ملء الشاشة (f)
exit full mode
سؤال
What would the browser display if it executed the following script
< script type = "text/javascript" >
< !--
For ( var count = 0; count < 10; ++count )
{
If ( count == 5 )
Continue;
}
Document.writeln( count );
//-- >
< /script >

A) Nothing; the script would generate an error.
B) 5
C) 9
D) 10
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
In a switch statement, the ________ case clause is used to process exceptional conditions and is usually listed last.

A) break
B) default
C) else
D) then
سؤال
What is the value of num after the following statement is performed
Num = 2 * Math.pow( 2, 3 );

A) 16
B) 18
C) 64
D) 8
سؤال
Switch statements contain ________ labels.

A) select
B) if...else
C) case
D) choice
سؤال
The ________ multiple-selection statement is used to handle decision making and can be used to replace multiple if and if...else statements.

A) do...while
B) case
C) break
D) switch
سؤال
Consider the following code selections. Assume count is initialized to 7 and num is initialized to 0.
I) ii)
Do
{ while ( count < 6 )
Num = count; num = count;
} while ( count < 6 )
What will the value of num be for i) and ii) respectively after the loops have been executed

A) 0, 0
B) 0, 7
C) 7, 0
D) 7, 7
سؤال
What would the browser display if it executed the following script
< script type = "text/javascript" >
< !--
For ( var count = 1; count < = 10; ++count )
{
If ( count == 5 )
Break;
}
Document.writeln( count );
//-- >
< /script >

A) Nothing; the script would generate an error.
B) 1
C) 5
D) 10
سؤال
Which of the following will not evaluate to true

A) false || false
B) true || true
C) false || true
D) true || false
سؤال
Which of the following will not evaluate to false

A) false && false
B) true && true
C) false && true
D) true && false
سؤال
What would the browser display if the following script were executed
< script type = "text/javascript" >
< !--
For ( var i = 0; i < 5; i++ )
Document.write( "O" );
//-- >
< /script >

A) Nothing; the script would generate an error
B) OOOO
C) OOOOO
D) OOOOOO
سؤال
Which of the following is not required for counter-controlled repetition

A) final value
B) initial value
C) sentinel
D) increment
سؤال
What is the value of num after the following statements are performed
Num = 2.4589;
Num = num.toFixed( 2 );

A) 2
B) 2.46
C) 2.5
D) 2.45
سؤال
What should you use as a counter in counter-controlled repetition

A) a floating-point number
B) a sentinel
C) an integer
D) a num object
سؤال
What would the browser display if it executed the following script
< script type = "text/javascript" >
< !--
Var i = 0;
Do
{
Document.write( "O" );
I++;
} while ( i > 5 );
//-- >
< /script >

A) Nothing; the script would generate an error
B) O
C) OOOOO
D) OOOOOO
سؤال
What would the browser display if the following script were executed
< script type = "text/javascript" >
< !--
For ( var i = 0; var i < 5; var i++ )
Document.write( "X" );
//-- >
< /script >

A) Nothing; the script would generate an error
B) XXXX
C) XXXXX
D) XXXXXX
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/15
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 8: Javascript: Control Statements II
1
What would the browser display if it executed the following script
< script type = "text/javascript" >
< !--
For ( var count = 0; count < 10; ++count )
{
If ( count == 5 )
Continue;
}
Document.writeln( count );
//-- >
< /script >

A) Nothing; the script would generate an error.
B) 5
C) 9
D) 10
D
2
In a switch statement, the ________ case clause is used to process exceptional conditions and is usually listed last.

A) break
B) default
C) else
D) then
B
3
What is the value of num after the following statement is performed
Num = 2 * Math.pow( 2, 3 );

A) 16
B) 18
C) 64
D) 8
A
4
Switch statements contain ________ labels.

A) select
B) if...else
C) case
D) choice
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
5
The ________ multiple-selection statement is used to handle decision making and can be used to replace multiple if and if...else statements.

A) do...while
B) case
C) break
D) switch
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
6
Consider the following code selections. Assume count is initialized to 7 and num is initialized to 0.
I) ii)
Do
{ while ( count < 6 )
Num = count; num = count;
} while ( count < 6 )
What will the value of num be for i) and ii) respectively after the loops have been executed

A) 0, 0
B) 0, 7
C) 7, 0
D) 7, 7
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
7
What would the browser display if it executed the following script
< script type = "text/javascript" >
< !--
For ( var count = 1; count < = 10; ++count )
{
If ( count == 5 )
Break;
}
Document.writeln( count );
//-- >
< /script >

A) Nothing; the script would generate an error.
B) 1
C) 5
D) 10
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
8
Which of the following will not evaluate to true

A) false || false
B) true || true
C) false || true
D) true || false
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
9
Which of the following will not evaluate to false

A) false && false
B) true && true
C) false && true
D) true && false
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
10
What would the browser display if the following script were executed
< script type = "text/javascript" >
< !--
For ( var i = 0; i < 5; i++ )
Document.write( "O" );
//-- >
< /script >

A) Nothing; the script would generate an error
B) OOOO
C) OOOOO
D) OOOOOO
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following is not required for counter-controlled repetition

A) final value
B) initial value
C) sentinel
D) increment
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
12
What is the value of num after the following statements are performed
Num = 2.4589;
Num = num.toFixed( 2 );

A) 2
B) 2.46
C) 2.5
D) 2.45
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
13
What should you use as a counter in counter-controlled repetition

A) a floating-point number
B) a sentinel
C) an integer
D) a num object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
14
What would the browser display if it executed the following script
< script type = "text/javascript" >
< !--
Var i = 0;
Do
{
Document.write( "O" );
I++;
} while ( i > 5 );
//-- >
< /script >

A) Nothing; the script would generate an error
B) O
C) OOOOO
D) OOOOOO
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
15
What would the browser display if the following script were executed
< script type = "text/javascript" >
< !--
For ( var i = 0; var i < 5; var i++ )
Document.write( "X" );
//-- >
< /script >

A) Nothing; the script would generate an error
B) XXXX
C) XXXXX
D) XXXXXX
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 15 في هذه المجموعة.