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

Performing Calculations

True or False



1

Numbers entered into a text field are actually stored as strings.
A)TRUE
B)FALSE
2

In JavaScript, the spaces on either side of a mathematical operator in an expression (for example, 2 + 2) are required.
A)TRUE
B)FALSE
3

alert(Math.floor(3.14159)) would display 4
A)TRUE
B)FALSE
4

The statement var PI = Math.parseFloat("3.14159") assigns the number 3.14159 to the variable PI.
A)TRUE
B)FALSE
5

The statement var PI = parseFloat("3.1-4159") assigns the number 3.1 to the variable PI.
A)TRUE
B)FALSE
6

According to our text, a global variable may be referenced in any script in a source document.
A)TRUE
B)FALSE
7

It is a good practice to never omit the var keyword when declaring variables.
A)TRUE
B)FALSE
8

A variable declared without the var keyword always has global scope.
A)TRUE
B)FALSE
9

It is a good practice to declare all global variables at the beginning of a script, as it makes the script more readable.
A)TRUE
B)FALSE
10

The statement alert(Math.pow(2, 3)) would display 9
A)TRUE
B)FALSE




McGraw-Hill/Irwin