| d. single-alternative selection 4. When you execute an ifelse statement, _____ takes place depending on the evaluation of the Boolean expression. | a. the second action always takes place and then the first action | | | | b. only one of the resulting actions | | | | c. the first action always takes place and then the second action | | | | d. none of the actions 5. In Java, the value of (4 > 7) is _____. | | | | d. false 6. If you want to take more than one action following the evaluation of a Boolean expression within an if statement, you use a pair of _____ to place the dependent statements within a block. | | | | d. colons 7. When you declare a variable within a block, it _____. | | b. is available to every block within the program | | | | c. is local to that block | | | | d. is a class-level variable 8. Statements in which an if statement is contained inside another if statement commonly are called _____ if statements. | | | | d. child 9. An expression that combines Boolean tests into a single expression using the logical AND and OR operators are known as a(n) _____ condition. | | | | d. included 10. A _____ is a series of statements that determine to which of several consecutive series of values another value falls. | | | | d. range check 11. The operator that combines two conditions into a single Boolean value that is true only when both of the conditions are true, but is false otherwise, is _____. | | | | d. $$ 12. The operator that combines two conditions into a single Boolean value that is true when at least one of the conditions is true is _____. | | | | d. && 13. Assuming a variable f has been initialized to 5, which of the following statements sets g to 0? | a. All of the above statements set g to 0 | | | | b. if(f >= 0 || f < 2) g = 0; | | | | c. if(f < 3 || f > 4) g = 0; | | | | d. if(f > 6 || f == 5) g = 0; 14. Which of the following groups has the lowest operator precedence? | | | | d. equality 15. When you must make a series of decisions in a program, it is most efficient to first ask the question that is most likely to be _____. | | b. not applicable to the user | | | | | d. true 16. The _____ feature is one in which expressions on each side of the && and || operators are evaluated only as far as necessary to determine whether the entire expression is true or false. | a. short-circuit evaluation | | | | | | d. range-check evaluation 17. You can use the _____ statement to terminate a switch structure. | | | | d. continue 18. The switch statement is useful when you need to test a single variable against a series of any of the following values except a(n) _____. | | | | d. double 19. Which of the following shows the correct syntax for the conditional operator? | a. testExpression ? trueResult ? falseResult; | | | | b. testExpression ? falseResult : trueResult; | | | | c. testExpression : trueResult : falseResult; | | | | d. testExpression ? trueResult : falseResult; 20. Assuming a variable y has been assigned the value 6, the value of !(y < 7) is _____. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |