Question 1 (5 points)Which is equivalent to if ( ! ( grade == sentinelValue ) )?
Question 1 options:
if ( grade !== sentinelValue )
if ( grade != sentinelValue )
if ( grade == sentinelValue )
if ( grade !== sentinelValue )
SaveQuestion 2 (5 points)The __________ always performs the logic condition test after executing the loop’s body, so the body always executes at least once.
Question 2 options:
for loop
case statement
do while loop
switch statement
SaveQuestion 3 (5 points)In a loop, the programmer can continue execution within the executing block of code, but skip all remaining lines and simply return to the loop continuation test by using the __________ statement.
Question 3 options:
default
continue
break
XOr
SaveQuestion 4 (5 points)The programmer can perform different actions based on the value of an expression in a __________ statement.
Question 4 options:
for
case
do while
switch
SaveQuestion 5 (5 points)The loop body of a do…while statement always executes:
Question 5 options:
zero times.
at least once.
more than once.
undeterminable.
SaveQuestion 6 (5 points)In a switch statement, the __________ case will execute code when no match occurs between the switch’s expression label and the case label.
Question 6 options:
default
continue
break
XOr
SaveQuestion 7 (5 points)The conditional AND operator is represented by which of the following?
Question 7 options:
&&
&
||
^
SaveQuestion 8 (5 points)In a switch statement, the programmer can terminate execution within the executing case by using the __________ statement.
Question 8 options:
default
continue
break
XOr
SaveQuestion 9 (5 points)The Boolean logic AND operator is represented by which of the following?
Question 9 options:
&&
&
||
!
SaveQuestion 10 (5 points)Assuming a is a bool with a value of false, which of the following evaluates to true?
Question 10 options:
!(!a)
a
!a
!a!
SaveQuestion 11 (5 points)The && and && operators will __________ evaluate all operands in a conditional statement.
Question 11 options:
never
always
conditionally
prematurely
SaveQuestion 12 (5 points)The __________ loop always performs the logic condition test before attempting to execute the loop’s body.
Question 12 options:
for
case
do while
switch
SaveQuestion 13 (5 points)In a loop, the programmer can terminate execution within the executing block of code by using the __________ statement.
Question 13 options:
default
continue
break
XOr
SaveQuestion 14 (5 points)The for loop header has three items specified: control variable initialization, the loop continuation condition, and __________ of the control variable.
Question 14 options:
increment/decrement
looping
switch
break
SaveQuestion 15 (5 points)When attempting to use a for statement’s control value after the loop’s body, what will the result be?
Question 15 options:
A compiler error
An infinite loop
Code execution stops after 100 loops based on the debugger settings
True
SaveQuestion 16 (5 points)The | and & operators will __________ evaluate all operands in a conditional statement.
Question 16 options:
never
always
conditionally
prematurely
SaveQuestion 17 (5 points)Which of the following operators ensures that at least one out of multiple conditions is TRUE?
Question 17 options:
||
&&
==
^
SaveQuestion 18 (5 points)Which of the following statements about the break statement is FALSE?
Question 18 options:
The break statement is used to exit a repetition statement early and continue execution after the loop.
A break statement can only break out of an immediately enclosing <strong>while, for, do…while</strong> , or <strong>switch </strong> statement.
The break statement, when executed in a <strong>while, for</strong> , or <strong>do…while</strong> , skips the remaining statements in the loop body and proceeds with the next iteration of the loop.
Common uses of the break statement are to escape early from a loop or to skip the remainder of a switch.
SaveQuestion 19 (5 points)The conditional OR operator is represented by which of the following?
Question 19 options:
&&
|
||
^
SaveQuestion 20 (5 points)The Boolean logic OR operator is represented by which of the following?
Question 20 options:
&&
&
||
|