
Signature ____________________ Name _____________________
cs3f_____
Student ID ___________________ Score:
Quiz 5
CSE 3
Fall 2005
Circle the correct answer.
1. Local variables 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. Output directly onto a Web page from JavaScript (as if it was HTML code typed in directly onto a Web
page) is done with:
A. document.alert()
B. document.write()
C. document.print()
D. HTML tags like <form>
3. Inputs to a function (the identifiers in the parens of a function definition) are called/known as:
A. defaults
B. parameters
C. globals
D. input elements
4. In JavaScript, a line beginning with // is a(n):
A. assignment statement
B. double divide statement
C. double quoted string
D. comment
5. Which of the following iterates 10 times?
A.
for (i = 1; i <= 11; i = i + 1)
B. for (i = 0; i < 10; i = i + 1)
C. for (i = 10; i >= 0; i = i - 1)
D. all of the above
6. In JavaScript, the plus sign always means:
A. addition
B. add 1
C. concatenation
D. A or C
(Over)