October 2006
Beginner to intermediate
352 pages
9h 33m
English
In the following, add parentheses to the expression so that it evaluates to 8:
var valA = 37; var valB = 3; var valC = 18; var resultOfComp = valA - valB % 3 / 2 * 4 + valC - 3;
Using a switch statement,
test an expression for a value of one, two, or three, and set a
variable to OK if the expression is one or two; OK2 if the
expression is three; and NONE if it doesn’t match any.
You have three variables, varOne, varTwo, and varThree. How would you test all three
such that a block of code is processed only if varOne is 33, varTwo is less than or equal to 100, but
varThree is greater than
0?
Execute a loop and print out every number between 10 and 20.
Now do the same counting backward.
Answers are provided in the appendix.
Read now
Unlock full access