Question: 1.) With switch blocks if you don't include a break statement then execution continues within in the switch block until the next break statement or
1.)
With switch blocks if you don't include a break statement then execution continues within in the switch block until the next break statement or the end of the block.
True
False
2.)
With a switch statement the structure is set up to compare the variable value or expression in the parentheses of switch(expr) to a case label. If there is a match the code for that case is executed.
True
False
3.)
If an if-statement or loop header has several statements associated with it you must enclose those statements in curly braces.
True
False
4.)
In a switch statement if none of the case labels match the tested variable or expression then the else clause is executed.
True
False
5.)
Assuming you don't use xor how do you test whether one and only one of two variables is zero?
| if ($x == 0 and $y != 0 or $y == 0 and $x != 0) | ||||||||||||||||||||||||||
| if ($x = 0 or $y = 0) | ||||||||||||||||||||||||||
| if ($x == 0 or $y == 0) | ||||||||||||||||||||||||||
| if ($x == 0 and $y != 0 and $y == 0 and $x != 0) 6.) What value of $temp short circuits the $temp <= 100 test in this expression? if ($temp >= 32 and $temp <= 100)
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
