Question :
19.2 Multiple Choice
1) Variable names declared in a function:
A) can : 1907256
19.2 Multiple Choice
1) Variable names declared in a function:
A) can be used outside that function
B) cannot be changed within that function
C) can be used outside the function, but cannot be changed outside the function
D) can only be used in that function
2) All of the following are parts of a function except:
A) the name
B) parameters
C) global variables
D) the definition
3) Output directly onto a Web page from JavaScript is done using:
A) writeln( )
B) document.write( )
C) print( )
D) document.display( )
4) A variable declared in a function is a(n):
A) local variable
B) global variable
C) independent variable
D) named variable
5) In JavaScript, the result of a function call can be printed on the monitor:
A) with the alert( ) call
B) interactively after the page is displayed
C) while building the page on the fly
D) all of the above
6) A function that cannot be reused:
A) should not be written
B) is called a global function
C) cannot be used as a building block
D) all of the above
7) The JavaScript function that retrieves the current date and time in numeric form is:
A) Now( )
B) CurrentDate( )
C) Math.Today( )
D) Date( )
8) The JavaScript function toString( ):
A) converts a numeric form to a printable form
B) returns the length of a string of characters
C) displays the JavaScript on a Web page
D) saves the answer to a file
9) Which of the following is an alternate term for function?
A) procedure
B) subroutine
C) method
D) all of the above
10) To find the time between two dates using JavaScript, you would:
A) multiply the difference of two dates by 365 to find days
B) subtract the number for January 1, 1970 from the answer
C) divide the difference by 1000 to find the seconds
D) compute the answer in years, days, hours, minutes, and seconds
11) Which of the following functions loads the page that is specified as its first argument?
A) window.open( )
B) window.new( )
C) window.page( )
D) none of the above
12) The inputs to a function are called:
A) identifiers
B) parameters
C) values
D) algorithms
13) The random numbers generated by Math.random( ):
A) will never be repeated
B) are really pseudo-random
C) are random because the computer is deterministic
D) are negative numbers
14) The values returned by the Math.random( ) function are between:
A) 0 (inclusive) and 1 (exclusive)
B) 0 (exclusive) and 1 (inclusive)
C) 0 (exclusive) and 1 (exclusive)
D) 0 (inclusive) and 1(inclusive)