Deck 9: Javascript: Functions

ملء الشاشة (f)
exit full mode
سؤال
Functions that are not provided as part of the JavaScript language are called ________ functions.

A) add-on
B) programmer-defined
C) man-made
D) extra
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The value a in the following statement is called the ________ and the value b is called the ________.
Face = Math.floor( a + Math.random() * b );

A) scaling factor, shifting value
B) shifting value, scaling factor
C) scaling value, shifting factor
D) shifting factor, scaling value
سؤال
The "prepackaged" functions that belong to JavaScript objects such as Math.pow and Math.round are often called ________.

A) subroutines
B) routines
C) methods
D) functions
سؤال
The best way to develop and maintain a large program is to construct it from small, simple pieces called ________.

A) scripts
B) modules
C) scriptlets
D) objects
سؤال
Which of the following is used to access members (or properties) of form elements

A) *
B) ,
C) )
D) ;
سؤال
If the HTML5 form game has a text field named point in it, what is the proper way to set the text associated with point to 10

A) game.point = "10"
B) game.point.text = "10"
C) game.point.caption = "10"
D) game.point.value = "10"
سؤال
The technique of developing and maintaining a large program by constructing it from small, simple pieces is called ________.

A) divide and conquer
B) modular programming
C) multitasking
D) multiprogramming
سؤال
The style of programming in which the user interacts with a GUI component is called ________ programming.

A) object-oriented
B) automatic
C) event-driven
D) modular
سؤال
Which of the following is not a global function

A) parseInt
B) escape
C) square
D) eval
سؤال
Nested in the audio element are two ________ specifying the locations of the audio clip in MP3 and OGG formats, respectively.

A) source elements
B) media elements
C) preload attributes
D) location elements
سؤال
JavaScript references the ________ object for you when you call its functions, so you don't need to use it directly.

A) document
B) local
C) scriptlevel
D) Global
سؤال
All variables declared in function definitions are ________.

A) global variables
B) local variables
C) static variables
D) constant variables
سؤال
Which of the following is a legal function call for the function definition provided below
Function square( y )
{
Return y * y;
}

A) square(7+2);
B) (7).square;
C) square(7,2);
D) square 7;
سؤال
Change an image's ________ attribute to change which picture it displays.

A) location
B) URL
C) src
D) source
سؤال
Which of the following are valid names of scopes in JavaScript

A) local
B) global
C) variable
D) Both (a) and (b)
سؤال
What is the result of writing the keyword var in a function parameter list

A) The result would be a JavaScript runtime error.
B) The parameter following the keyword would have global scope.
C) The parameter following the keyword would have local scope.
D) The parameter following the keyword would become a static variable.
سؤال
A function's ________ are also considered to be local variables.

A) parameters
B) static variables
C) register variabless
D) constant variables
سؤال
Giving a local function variable the same name as a global variable will result in which of the following

A) JavaScript runtime error.
B) Data corruption.
C) The local function variable will rename itself.
D) The local variable will "hide" the global variable.
سؤال
What does the following statement do
Math.floor( Math.random() * 12 );

A) This creates a random number from 0 up to and including 12.
B) This creates a random number from 0 up to but not including 12.
C) This creates a random number from 1 up to and including 12.
D) This creates a random number from 1 up to but not including 12.
سؤال
What would the function cube return, assuming it is called with the statement cube( 3 )
Function cube( y );
{
Return y * y * y;
}

A) JavaScript runtime error
B) 3
C) 9
D) 27
سؤال
Iteration uses ________ statements and recursion uses ________ statements.

A) counter-recursive, counter-iterative
B) repetition, function calling
C) repetition, selection
D) function-calling, repetition
سؤال
A function that calls itself either directly or indirectly through another function is called a ________ function.

A) base case
B) iterative
C) recursive
D) fibonacci
سؤال
When does a recursive program go into infinite recursion

A) if the loop-continuation test never becomes false
B) if the recursion test never becomes false
C) if the loop-continuation test never becomes true
D) if the recursion step does not converge on the base case
سؤال
When a function invokes a new copy of itself, it is called a ________.

A) base case
B) final step
C) base case
D) recursive call
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/24
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 9: Javascript: Functions
1
Functions that are not provided as part of the JavaScript language are called ________ functions.

A) add-on
B) programmer-defined
C) man-made
D) extra
B
2
The value a in the following statement is called the ________ and the value b is called the ________.
Face = Math.floor( a + Math.random() * b );

A) scaling factor, shifting value
B) shifting value, scaling factor
C) scaling value, shifting factor
D) shifting factor, scaling value
B
3
The "prepackaged" functions that belong to JavaScript objects such as Math.pow and Math.round are often called ________.

A) subroutines
B) routines
C) methods
D) functions
C
4
The best way to develop and maintain a large program is to construct it from small, simple pieces called ________.

A) scripts
B) modules
C) scriptlets
D) objects
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following is used to access members (or properties) of form elements

A) *
B) ,
C) )
D) ;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
6
If the HTML5 form game has a text field named point in it, what is the proper way to set the text associated with point to 10

A) game.point = "10"
B) game.point.text = "10"
C) game.point.caption = "10"
D) game.point.value = "10"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
7
The technique of developing and maintaining a large program by constructing it from small, simple pieces is called ________.

A) divide and conquer
B) modular programming
C) multitasking
D) multiprogramming
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
8
The style of programming in which the user interacts with a GUI component is called ________ programming.

A) object-oriented
B) automatic
C) event-driven
D) modular
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
9
Which of the following is not a global function

A) parseInt
B) escape
C) square
D) eval
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
10
Nested in the audio element are two ________ specifying the locations of the audio clip in MP3 and OGG formats, respectively.

A) source elements
B) media elements
C) preload attributes
D) location elements
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
11
JavaScript references the ________ object for you when you call its functions, so you don't need to use it directly.

A) document
B) local
C) scriptlevel
D) Global
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
12
All variables declared in function definitions are ________.

A) global variables
B) local variables
C) static variables
D) constant variables
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which of the following is a legal function call for the function definition provided below
Function square( y )
{
Return y * y;
}

A) square(7+2);
B) (7).square;
C) square(7,2);
D) square 7;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
14
Change an image's ________ attribute to change which picture it displays.

A) location
B) URL
C) src
D) source
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which of the following are valid names of scopes in JavaScript

A) local
B) global
C) variable
D) Both (a) and (b)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
16
What is the result of writing the keyword var in a function parameter list

A) The result would be a JavaScript runtime error.
B) The parameter following the keyword would have global scope.
C) The parameter following the keyword would have local scope.
D) The parameter following the keyword would become a static variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
17
A function's ________ are also considered to be local variables.

A) parameters
B) static variables
C) register variabless
D) constant variables
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
18
Giving a local function variable the same name as a global variable will result in which of the following

A) JavaScript runtime error.
B) Data corruption.
C) The local function variable will rename itself.
D) The local variable will "hide" the global variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
19
What does the following statement do
Math.floor( Math.random() * 12 );

A) This creates a random number from 0 up to and including 12.
B) This creates a random number from 0 up to but not including 12.
C) This creates a random number from 1 up to and including 12.
D) This creates a random number from 1 up to but not including 12.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
20
What would the function cube return, assuming it is called with the statement cube( 3 )
Function cube( y );
{
Return y * y * y;
}

A) JavaScript runtime error
B) 3
C) 9
D) 27
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
21
Iteration uses ________ statements and recursion uses ________ statements.

A) counter-recursive, counter-iterative
B) repetition, function calling
C) repetition, selection
D) function-calling, repetition
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
22
A function that calls itself either directly or indirectly through another function is called a ________ function.

A) base case
B) iterative
C) recursive
D) fibonacci
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
23
When does a recursive program go into infinite recursion

A) if the loop-continuation test never becomes false
B) if the recursion test never becomes false
C) if the loop-continuation test never becomes true
D) if the recursion step does not converge on the base case
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
24
When a function invokes a new copy of itself, it is called a ________.

A) base case
B) final step
C) base case
D) recursive call
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 24 في هذه المجموعة.