McGraw-Hill OnlineMcGraw-Hill Higher EducationLearning Center
Student Center | Instructor Center | Information Center | Home
Sample Code
Multiple Choice Quiz
True or False
E-Lectures
Feedback
Help Center


Programming the Web Using XHTML and JavaScript
Larry Randles Lagerstrom

Objects and Variables

Multiple Choice Quiz



1

A module of code that belongs to an object is called a(n) ________
A)state variable
B)parameter
C)method
D)argument
2

A software object consists of two things bundled together:
A)behavior and methods
B)states and properties
C)messages and methods
D)data and code modules
3

In the statement changeGrind("fine"), fine is called a(n) _________
A)variable
B)method
C)property
D)parameter
4

Which is not a valid floating point number?
A)3.14159
B)2,718.00
C).3
D)3.
5

Which is NOT one of JavaScript's three data types?
A)numbers
B)Boolean
C)string
D)complex
6

What is the value of the variable named sayWhat after the following lines of code are executed? var sayWhat = "hello" sayWhat = "goodbye"
A)"hello"
B)"goodbye"
C)undefined
D)none of the above
7

What is the value of the variable named sayWhat after the following lines of code are executed? var sayHello = "hello", sayGoodbye = "goodbye" sayHello = sayGoodbye
A)"hello"
B)"goodbye"
C)"sayGoodby"
D)"sayHello"
8

What is displayed by the call to alert()? var sayHello = "hello" alert("sayHello")
A)"hello"
B)"sayHello"
C)"enter name"
D)"goodbye"
9

What is displayed by the call to alert()? var first = "Ada", last = "Lovelace" alert("hello " + first + last)
A)hello first last
B)hello Ada Lovelace
C)hello + first + last
D)hello + Ada + Lovelace
10

Which statement causes a new HTML document to be displayed in the browser?
A)location.href = "http://www.cs.uoregon.edu/classes/cis111/"
B)window.location.href = "http://www.cs.uoregon.edu/classes/cis111/"
C)both A and B
D)neither A nor B




McGraw-Hill/Irwin