with Correct Answers
The act of using a C++ stream object in a logical expression as if it were a Boolean
variable is called ____________________ of the stream. - Answer-testing the state
An If statement is an example of a(n) ____________________ control structure -
Answer-selection
The operators &&, ||, and ! are known as ____________________ operators - Answer-
logical
Write a C++ logical expression that is false if either x or y is equal to 5:
____________________ - Answer-x != 5 && y != 5
True or False? Testing is performed only in the implementation phase of a program's life
cycle - Answer-false
The operators <, ==, >=, and != are examples of ____________________ operators -
Answer-relational
An If-Then-Else-If structure represents a(n) ____________________-way branch -
Answer-multi
A(n) ____________________ expression is an expression composed of logical
(Boolean) values and operations. - Answer-logical
In programming languages that use ____________________ evaluation of a logical
expression, evaluation proceeds in left-to-right order and stops as soon as the final truth
value can be determined. - Answer-short-circuit
The phrase "minimum complete coverage" means that we test a program with
A.
all possible data values.
B.
data that executes every branch at least once.
C.
at least one set of data.
D.
, data that executes all possible combinations of branches at least once. - Answer-data
that executes every branch at least once.
Given the following code:
string name1;
string name2;
name1 = "Mark";
name2 = "Mary";
what is the value of the relational expression string1 < string2 ?
A.
none; it causes a compile-time error
B.
true
C.
none; it causes a run-time error
D.
false - Answer-True
True or False? Implementing a test plan guarantees that a program is completely
correct. - Answer-False
In order to test the boundaries of the following condition, what data values would you
use for the variable alpha? (alpha is of type int.) alpha >= 1
A.
INT_MIN, 1, 2, and INT_MAX
B.
INT_MIN, 0, 1, and INT_MAX
C.
INT_MIN, 1, and INT_MAX
D.
1, 2, and INT_MAX
E.
0, 1, and INT_MAX - Answer-INT_MIN, 0, 1, and INT_MAX
True or False? According to DeMorgan's Law, the expression !(x <= y || s > t) is
equivalent to x <= y && s > t - Answer-False
Given a Boolean variable isEmpty, which of the following is a valid C++ assignment
statement?
A.
isEmpty = true;
B.
isEmpty = !isEmpty;
C.
isEmpty = m > n;
D.