Exam 4: Control Structures I Selection

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

In C++, && has a higher precedence than ||.

(True/False)
4.8/5
(45)

If the expression in an assert statement evaluates to true, the program terminates.

(True/False)
4.9/5
(36)

In a switch statement, if the value of the expression does not match any of the case values, the statements following the ____________________ label execute.

(Short Answer)
4.7/5
(46)

What does <= mean?

(Multiple Choice)
4.8/5
(42)

The value of the expression 6 < 5 || 'g' > 'a' && 7 < 4 is ____________________.

(True/False)
4.9/5
(37)

The ____________________ of relational and logical operators is said to be from left to right.

(Short Answer)
4.9/5
(34)

Suppose that x is an int variable. Which of the following expressions always evaluates to true?

(Multiple Choice)
4.9/5
(42)

When one control statement is located within another, it is said to be ____.

(Multiple Choice)
4.8/5
(38)

Which of the following operators has the highest precedence?

(Multiple Choice)
4.7/5
(40)

In a ____ control structure, the computer executes particular statements depending on some condition(s).

(Multiple Choice)
4.8/5
(32)

Once an input stream enters a(n) ____________________ state, all subsequent input statements associated with that input stream are ignored, and the computer continues to execute the program, which produces erroneous results.

(Short Answer)
4.9/5
(43)

The value of the expression 7 + 8 <= 15 is ____________________.

(True/False)
4.8/5
(34)

A compound statement functions as if it was a single statement.

(True/False)
4.8/5
(43)

For a program to use the assert function, it must include which of the following?

(Multiple Choice)
5.0/5
(44)

Which of the following is the "not equal to" relational operator?

(Multiple Choice)
4.9/5
(42)

Which of the following expressions correctly determines that x is greater than 10 and less than 20?

(Multiple Choice)
4.8/5
(40)

Which of the following will cause a logical error if you are attempting to compare x to 5?

(Multiple Choice)
4.8/5
(24)

Suppose found = true and num = 6. The value of the expression (!found) || (num > 6) is ____________________.

(Short Answer)
4.9/5
(36)

Putting a semicolon after the parentheses following the expression in an if statement (that is, before the statement) is a(n) ____________________ error.

(Short Answer)
4.8/5
(39)

In C++, the operators != and == have the same order of precedence.

(True/False)
4.8/5
(30)
Showing 21 - 40 of 40
close modal

Filters

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