Exam 4: Control Structures I Selection

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

You can disable assert statements by using which of the following?

Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
Verified

D

The result of a logical expression cannot be assigned to an int variable, but it can be assigned to a bool variable.

Free
(True/False)
4.8/5
(35)
Correct Answer:
Verified

False

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

Free
(Multiple Choice)
4.7/5
(32)
Correct Answer:
Verified

B

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

(True/False)
4.9/5
(41)

Which of the following operators has the lowest precedence?

(Multiple Choice)
4.9/5
(32)

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
(36)

In C++, both ! and != are relational operators.

(True/False)
4.7/5
(41)

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

(Multiple Choice)
4.7/5
(40)

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

(True/False)
4.9/5
(37)

Which of the following is a relational operator?

(Multiple Choice)
4.9/5
(42)

Consider the following statements. If score is equal to 75, the value of grade is "____________________". Consider the following statements. If score is equal to 75, the value of grade is ____________________.

(Short Answer)
4.9/5
(30)

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
(32)

The term ____________________ describes a process in which the computer evaluates a logical expression from left to right and stops as soon as the value of the expression is known.

(Short Answer)
5.0/5
(33)

What does <= mean?

(Multiple Choice)
4.9/5
(46)

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

(True/False)
4.8/5
(40)

What is the output of the following code? What is the output of the following code?

(Multiple Choice)
4.9/5
(39)

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

(True/False)
4.7/5
(40)

What is the output of the following C++ code? What is the output of the following C++ code?

(Multiple Choice)
4.7/5
(31)

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

(Multiple Choice)
4.9/5
(36)

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

(Multiple Choice)
4.8/5
(39)
Showing 1 - 20 of 40
close modal

Filters

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