Exam 4: Making Decisions

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

What is the value of the following expression? true && false

(Multiple Choice)
4.7/5
(66)

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

(True/False)
4.9/5
(83)

This operator represents the logical AND.

(Multiple Choice)
4.8/5
(80)

What is the output of the following code? int w = 98; int x = 99; int y = 0; int z = 1; if (x >= 99) { \quad if (x < 99) \quad\quad cout << y << endl; \quad else \quad\quad cout << z << endl; } else { \quad If (x == 99) \quad\quad cout << x << endl; \quad else \quad\quad cout << w << endl; }

(Multiple Choice)
4.8/5
(78)

Whereas < is called a relational operator, x < y is called a(n)________________

(Multiple Choice)
4.9/5
(67)

When a relational expression is false, it has the value _____.

(Multiple Choice)
4.8/5
(75)

What is the value of the following expression? true || true

(Multiple Choice)
4.9/5
(77)

What is the value of donuts after the following code executes? int donuts = 10; if (donuts != 10) \quad donuts = 0; else \quad donuts += 2;

(Multiple Choice)
4.7/5
(70)

What is the value of the following expression? false || true

(Multiple Choice)
4.9/5
(83)

Relational operators allow you to ____________ numbers.

(Multiple Choice)
4.9/5
(87)

What will be the value of result after the following code has been executed? int a = 60; int b = 15; int result = 10; if (a = b) \quad result *= 2;

(Multiple Choice)
4.9/5
(91)

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

(Multiple Choice)
4.8/5
(77)

This is a variable, usually a boolean or an integer, that signals when a condition exists.

(Multiple Choice)
4.8/5
(87)
Showing 41 - 53 of 53
close modal

Filters

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