Filters
Question type

Study Flashcards

A pair of characters or a pair of string objects can be compared with any of the relational operators.

A) True
B) False

Correct Answer

verifed

verified

The following C++ test checks if the variable child is in the range 3 - 12. if (child >= 3 && <= 12)

A) True
B) False

Correct Answer

verifed

verified

The ________ operator is used in C++ to test for equality.


A) =
B) <>
C) &&
D) ==
E) ||

F) A) and E)
G) C) and E)

Correct Answer

verifed

verified

D

The ________ operator is known as the logical OR operator.


A) !
B) &
C) &&
D) ||
E) //

F) C) and D)
G) None of the above

Correct Answer

verifed

verified

D

A flag is a variable, usually of data type ________, that signals whether or not some condition exists.


A) char
B) string
C) int
D) bool
E) logical

F) A) and E)
G) A) and C)

Correct Answer

verifed

verified

The ________ statement causes other program statements to execute only under certain conditions.


A) logical
B) relational
C) cin
D) cout
E) if

F) A) and D)
G) None of the above

Correct Answer

verifed

verified

The statement pass = (score >= 7) ? True : false; does exactly the same thing as the if/else statement below: if (score >= 7) pass = True; else pass = false;

A) True
B) False

Correct Answer

verifed

verified

If a switch statement has no ________ statements, the program "falls through" all of the statements below the one with the matching case expression.


A) break
B) exit
C) case
D) default
E) relational

F) A) and C)
G) A) and E)

Correct Answer

verifed

verified

The ________ statement executes one block of statements if a test condition is True, and another block if the condition is false.


A) if
B) if/else
C) if/else if
D) switch
E) trailing else

F) A) and D)
G) A) and E)

Correct Answer

verifed

verified

Which of the following correctly declares an enumerated data type named student?


A) enum student { Bill, Tom, Mary };
B) enum student { "Bill", "Tom", "Mary" };
C) int Bill = 1, Tom = 2, Mary = 3; enum student { 1, 2, 3 };
D) Any of the above 3 methods will work.
E) None of the above 3 methods will work.

F) A) and E)
G) C) and E)

Correct Answer

verifed

verified

Relational operators connect two or more relational expressions into one, or reverse the logic of an expression.

A) True
B) False

Correct Answer

verifed

verified

The following C++ test checks if the variable child is in the range 3 to 12. if (child >= 3 || child <= 12)

A) True
B) False

Correct Answer

verifed

verified

When an if statement is placed within the conditionally-executed code of another if statement, this is known as a(n)


A) complex if
B) overloaded if
C) nested if
D) conditional if
E) double if

F) A) and D)
G) None of the above

Correct Answer

verifed

verified

The C++ ________ operator represents logical AND.


A) ++
B) . AND.
C) ||
D) &
E) &&

F) A) and D)
G) A) and C)

Correct Answer

verifed

verified

If the sub-expression on the left side of an || operator is True, the expression on the right side will not be checked.

A) True
B) False

Correct Answer

verifed

verified

True

The scope of a variable is the program it is defined in.

A) True
B) False

Correct Answer

verifed

verified

A(n) ________ is a variable, usually a bool, that signals when a condition exists.


A) flag
B) identifier
C) named constant
D) condition variable
E) logical variable

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

Relational expressions and logical expressions are both Boolean, which means they evaluate to True or false.

A) True
B) False

Correct Answer

verifed

verified

logical operators AND and OR have a higher precedence than the NOT operator.

A) True
B) False

Correct Answer

verifed

verified

The rule for matching an else with an if is that an else goes with the last if statement before it that doesn't have its own else.

A) True
B) False

Correct Answer

verifed

verified

Showing 1 - 20 of 40

Related Exams

Show Answer