Deck 7: Javascript: Control Statements I

ملء الشاشة (f)
exit full mode
سؤال
Which of the following statements is correct

A) If ( studentGrade >= 60 ) document.writeln( "Passed" );
B) if ( studentGrade >= 60 ); document.writeln( "Passed" );
C) if ( studentGrade >= 60 ) document.write( "Passed" );
D) If ( studentGrade >= 60 ); document.write( "Passed" );
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
What would the browser display if the following code were executed in a script
Var x = 11;
Var y = 14;
If ( x > 13 )
If ( y > 13 )
Document.writeln( "x and y are > 13" );
Else
Document.writeln( "x is < = 13" );

A) nothing
B) 11
C) x and y are > 13
D) x is < = 13
سؤال
Which of the following flowchart symbols can represent an if statement

A) diamond
B) oval/circle
C) rectangle
D) flowline
سؤال
What would the browser display if the following code were executed in a script
Var product = 0;
While (product >= 25)
Product = 2 + product;
Document.writeln( product );

A) nothing, the script would result in an error
B) 0
C) 24
D) 26
سؤال
If the string passed to parseInt contains a floating-point numeric value, parseInt will ________.

A) return NaN
B) return 0
C) round the value to the nearest tenth
D) truncate the floating-point part to be left with an integer value
سؤال
If the string passed to parseInt contains text characters, parseInt will ________.

A) return NaN
B) return 0
C) return the sum of the characters' ASCII values
D) truncate the text entries
سؤال
Which of the following flowchart symbols indicates that a decision is to be made

A) diamond
B) oval/circle
C) rectangle
D) flowline
سؤال
What would the browser display if the following script were executed
< script type = "text/javascript" >
Var count = 0;
Var total = 0;
While ( count < = 5 )
{
Total = total + 10;
Count = count + 1;
}
Document.write( total );
< /script >

A) Nothing; the browser would generate an error.
B) 0
C) 50
D) 60
سؤال
What would the browser display if the following code were executed in a script
Var product = 0;
While ( product < = 25 );
Product = 2 + product;

A) nothing, the script would result in an inifite-loop error
B) 0
C) 25
D) 26
سؤال
________ is an informal language that helps programmers develop algorithms.

A) JavaScript
B) ECMAScript
C) Pseudocode
D) AlgorithmCode
سؤال
The word sequence in the term sequence structure refers to the sequence of ________.

A) bits in a JavaScript instruction
B) JavaScript instructions in a script
C) scripts in an HTML file
D) HTML files in a Web site
سؤال
Research determined that all programs could be written in terms of only three control structures. Which of the following is not one of the three control structures

A) goto-less structure
B) sequence structure
C) selection structure
D) repetition structure
سؤال
Which of the following is a JavaScript repetition statement

A) while...repeat
B) do...while
C) do...repeat
D) for...do
سؤال
Which of the following is not a JavaScript selection statement

A) if...else
B) for...in
C) switch
D) if
سؤال
Specifying the order in which programming statements are to be executed is called ________.

A) program control
B) a program structure
C) a control structure
D) an algorithm
سؤال
What would the browser display if the following code were executed in a script
Var grade = 59;
If ( grade >= 60 )
Document.writeln( "Passed." );
Else
Document.write( "Failed. " );
Document.writeln( "You must take this course again." );

A) Passed.
B) Failed.
C) You must take this course again.
D) Failed. You must take this course again.
سؤال
A program in which all statements are executed one after the other in the order in which they are written exhibits ________.

A) transfer of control
B) algorithms
C) sequential execution
D) direct execution
سؤال
A procedure for solving a problem in terms of the actions to be executed and the order in which these actions are to be executed is called ________.

A) program control
B) a program structure
C) a control structure
D) an algorithm
سؤال
What would the browser display if the following script were executed
< script type = "text/javascript" >
Var count = 5;
Var total = 0;
While ( count > -1 )
{
Total = total - 10;
Count = count - 1;
}
Document.write( total );
< /script >

A) Nothing; the browser would generate an error.
B) 0
C) -50
D) -60
سؤال
Which of the following is not a JavaScript keyword

A) break
B) delete
C) sub
D) for
سؤال
The word top in the term top-down stepwise refinement refers to which of the following

A) the first statement that appears in the script
B) the first statement that appears in the algorithm
C) the single statement that completely represents the script
D) the entire algorithm
سؤال
What output will the following script produce
Var i = 0;
Var j = 3;
Var counter = 0;
While ( i < 5 )
{
If (i != j)
Counter = counter + i;
I = i + 1
}
Document.write( counter );

A) 9
B) 14
C) 3
D) 7
سؤال
What type of loop should be used in a script that processes test results for 150 students

A) counter controlled
B) sentinel controlled
C) algorithm controlled
D) stepwise controlled
سؤال
Which of the following is the correct abbreviation for the statement a = a * 7;

A) a =* 7;
B) a *= 7;
C) 7 =* a;
D) 7 *= a;
سؤال
What type of loop is shown in the script below
< script type = "text/javascript" >
Var gradeValue = 0,
Total = 0,
Grade = 0;
While ( gradeValue != - 1 )
{
Total = total + gradeValue;
Grade = window.prompt( "Enter Integer Grade, -1 to Quit:" , "0" );
GradeValue = parseInt( grade );
}
< /script >

A) counter controlled
B) sentinel controlled
C) algorithm controlled
D) stepwise controlled
سؤال
What is the value of i after the following statements
I = 2;
I--;
I--;

A) 0
B) 1
C) -2
D) -4
سؤال
What is the value of i after the following statements
I = 2;
I++;

A) 0
B) 2
C) 3
D) 4
سؤال
What is the output of the following script
I = 16;
Document.write( ++i );

A) 16
B) 17
C) 15
D) Nothing; the browser would generate an error.
سؤال
If the initial value of a is 15, what new value is assigned to a in the expression a %= 4

A) 2
B) 3
C) 4
D) 5
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/29
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 7: Javascript: Control Statements I
1
Which of the following statements is correct

A) If ( studentGrade >= 60 ) document.writeln( "Passed" );
B) if ( studentGrade >= 60 ); document.writeln( "Passed" );
C) if ( studentGrade >= 60 ) document.write( "Passed" );
D) If ( studentGrade >= 60 ); document.write( "Passed" );
C
2
What would the browser display if the following code were executed in a script
Var x = 11;
Var y = 14;
If ( x > 13 )
If ( y > 13 )
Document.writeln( "x and y are > 13" );
Else
Document.writeln( "x is < = 13" );

A) nothing
B) 11
C) x and y are > 13
D) x is < = 13
A
3
Which of the following flowchart symbols can represent an if statement

A) diamond
B) oval/circle
C) rectangle
D) flowline
A
4
What would the browser display if the following code were executed in a script
Var product = 0;
While (product >= 25)
Product = 2 + product;
Document.writeln( product );

A) nothing, the script would result in an error
B) 0
C) 24
D) 26
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
5
If the string passed to parseInt contains a floating-point numeric value, parseInt will ________.

A) return NaN
B) return 0
C) round the value to the nearest tenth
D) truncate the floating-point part to be left with an integer value
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
6
If the string passed to parseInt contains text characters, parseInt will ________.

A) return NaN
B) return 0
C) return the sum of the characters' ASCII values
D) truncate the text entries
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of the following flowchart symbols indicates that a decision is to be made

A) diamond
B) oval/circle
C) rectangle
D) flowline
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
8
What would the browser display if the following script were executed
< script type = "text/javascript" >
Var count = 0;
Var total = 0;
While ( count < = 5 )
{
Total = total + 10;
Count = count + 1;
}
Document.write( total );
< /script >

A) Nothing; the browser would generate an error.
B) 0
C) 50
D) 60
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
9
What would the browser display if the following code were executed in a script
Var product = 0;
While ( product < = 25 );
Product = 2 + product;

A) nothing, the script would result in an inifite-loop error
B) 0
C) 25
D) 26
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
10
________ is an informal language that helps programmers develop algorithms.

A) JavaScript
B) ECMAScript
C) Pseudocode
D) AlgorithmCode
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
11
The word sequence in the term sequence structure refers to the sequence of ________.

A) bits in a JavaScript instruction
B) JavaScript instructions in a script
C) scripts in an HTML file
D) HTML files in a Web site
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
12
Research determined that all programs could be written in terms of only three control structures. Which of the following is not one of the three control structures

A) goto-less structure
B) sequence structure
C) selection structure
D) repetition structure
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which of the following is a JavaScript repetition statement

A) while...repeat
B) do...while
C) do...repeat
D) for...do
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
14
Which of the following is not a JavaScript selection statement

A) if...else
B) for...in
C) switch
D) if
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
15
Specifying the order in which programming statements are to be executed is called ________.

A) program control
B) a program structure
C) a control structure
D) an algorithm
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
16
What would the browser display if the following code were executed in a script
Var grade = 59;
If ( grade >= 60 )
Document.writeln( "Passed." );
Else
Document.write( "Failed. " );
Document.writeln( "You must take this course again." );

A) Passed.
B) Failed.
C) You must take this course again.
D) Failed. You must take this course again.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
17
A program in which all statements are executed one after the other in the order in which they are written exhibits ________.

A) transfer of control
B) algorithms
C) sequential execution
D) direct execution
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
18
A procedure for solving a problem in terms of the actions to be executed and the order in which these actions are to be executed is called ________.

A) program control
B) a program structure
C) a control structure
D) an algorithm
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
19
What would the browser display if the following script were executed
< script type = "text/javascript" >
Var count = 5;
Var total = 0;
While ( count > -1 )
{
Total = total - 10;
Count = count - 1;
}
Document.write( total );
< /script >

A) Nothing; the browser would generate an error.
B) 0
C) -50
D) -60
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following is not a JavaScript keyword

A) break
B) delete
C) sub
D) for
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
21
The word top in the term top-down stepwise refinement refers to which of the following

A) the first statement that appears in the script
B) the first statement that appears in the algorithm
C) the single statement that completely represents the script
D) the entire algorithm
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
22
What output will the following script produce
Var i = 0;
Var j = 3;
Var counter = 0;
While ( i < 5 )
{
If (i != j)
Counter = counter + i;
I = i + 1
}
Document.write( counter );

A) 9
B) 14
C) 3
D) 7
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
23
What type of loop should be used in a script that processes test results for 150 students

A) counter controlled
B) sentinel controlled
C) algorithm controlled
D) stepwise controlled
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which of the following is the correct abbreviation for the statement a = a * 7;

A) a =* 7;
B) a *= 7;
C) 7 =* a;
D) 7 *= a;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
25
What type of loop is shown in the script below
< script type = "text/javascript" >
Var gradeValue = 0,
Total = 0,
Grade = 0;
While ( gradeValue != - 1 )
{
Total = total + gradeValue;
Grade = window.prompt( "Enter Integer Grade, -1 to Quit:" , "0" );
GradeValue = parseInt( grade );
}
< /script >

A) counter controlled
B) sentinel controlled
C) algorithm controlled
D) stepwise controlled
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
26
What is the value of i after the following statements
I = 2;
I--;
I--;

A) 0
B) 1
C) -2
D) -4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
27
What is the value of i after the following statements
I = 2;
I++;

A) 0
B) 2
C) 3
D) 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
28
What is the output of the following script
I = 16;
Document.write( ++i );

A) 16
B) 17
C) 15
D) Nothing; the browser would generate an error.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
29
If the initial value of a is 15, what new value is assigned to a in the expression a %= 4

A) 2
B) 3
C) 4
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.