Exam 4: Making Decisions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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

(True/False)
4.8/5
(32)

The ________ operator takes an operand and reverses its truth or falsehood.

(Multiple Choice)
4.8/5
(34)

Relational operators allow you to ________ numbers.

(Multiple Choice)
4.8/5
(36)

What will the following expression evaluate to? !( 6 > 7 || 3 == 4)

(Multiple Choice)
4.8/5
(38)

If s1 and s2 are string objects, s1 == s2 is True when

(Multiple Choice)
4.9/5
(37)

A switch statement branches to a particular block of code depending on the value of a numeric (i.e. integer or floating-point) variable or constant.

(True/False)
4.7/5
(33)

The ________ statement executes one statement, or block of statements, if a condition is True and skips it, doing nothing, if the condition is false.

(Multiple Choice)
4.9/5
(36)

The following statements will not print anything. x = 5; if (x < 5) cout << "Hello "; cout << "world \n";

(True/False)
4.8/5
(38)

An expression in a C++ if statement that evaluates to 5, -5, or for that matter anything other than 0, is considered True.

(True/False)
4.9/5
(33)

Assuming moreData is a Boolean variable, the following two tests are logically equivalent. if (moreData == True) if (moreData)

(True/False)
4.7/5
(38)

To check if a variable has a particular value, use the = relational operator, as in the statement if (s = 3) cout << "S has the value 3";

(True/False)
4.9/5
(32)

All of the relational operators are binary.

(True/False)
5.0/5
(40)

The expression x < y is called a(n) ________ expression.

(Multiple Choice)
4.8/5
(33)

The default section of a switch statement performs a similar task as the ________ portion of an if/else if statement.

(Multiple Choice)
4.7/5
(37)

The ________ statement acts like a chain of if statements. Each performs its test, one after the other, until one of them is found to be True or until the construct is exited without any test ever evaluating to True.

(Multiple Choice)
4.8/5
(24)

What will the following statement do if x equals 17 and answer = 20? Answer = x > 100 ? 0 : 1;

(Multiple Choice)
4.9/5
(39)

Assuming goodData is a Boolean variable, the following two tests are logically equivalent. if (goodData == false) if (!goodData)

(True/False)
4.9/5
(38)

When a program lets the user know that an invalid menu choice has been made, this is an example of

(Multiple Choice)
5.0/5
(40)

In C++ when a relational expression is false, it has the value

(Multiple Choice)
4.8/5
(40)

A trailing else placed at the end of an if/else if statement provides a default action when ________ of the if conditions is/are True.

(Multiple Choice)
4.8/5
(36)
Showing 21 - 40 of 40
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)