19 questions
The default section of a switch statement performs a similar task as the ________ portion of an if/else if statement.
conditional
break
trailing else
All of these
None of these
What is the value of donuts after the following code executes?
12
10
0
1
Given that, x = 2, y = 1, and z = 0, what will the following cout statement display?
answer = 0
answer = 1
answer = 2
None of these
This operator performs a logical NOT operation.
--
!
<>
><
None of these
This operator performs a logical OR operation.
--
//
#
||
None of these
These operators connect two or more relational expressions into one, or reverse the logic of an expression.
relational
logical
irrational
negation
None of these
Without this statement appearing in a switch construct, the program "falls through" all of the statements below the one with the matching case expression.
break
exit
switch
scope
None of these
When an if statement is placed within the conditionally-executed code of another if statement, this is known as:
complexity
overloading
nesting
validation
None of these
Assuming x is 5, y is 6, and z is 8, which of the following is false?
3, 4, 6, 7 are false.
Only 5 is false.
3 and 4 are false.
All are false.
None of these.
The ________ of a variable is limited to the block in which it is declared.
precedence
associativity
scope
branching ability
None of these
What is the value of the following expression?
true && false
true
false
-1
+1
What is the value of the following expression?
true || true
true
false
-1
+1
What is the value of the following expression?
false || true
true
false
-1
+1
Which value can be entered to cause the following code segment to display the message:
"That number is acceptable."
100
10
99
0
All of these
What will be the value of result after the following code has been executed?
10
120
20
This code will not compile.
Which statement allows you to properly check the char variable code to determine whether it is equal to a "C" and then output "This is a check" and then advance to a new line?
The following code correctly determines whether x contains a value in the range of 0 through 100.
True
False
An expression that has any value other than 0 is considered true by an if statement.
True
False
The default section is required in a switch statement.
True
False