Skip to main content

Section 3.8 Selection-WE4-P1

Subsection 3.8.1 Subgoals for Evaluating Selection Statements

  1. Diagram which statements go together.

  2. For if-statement, determine whether expression is true or false.

  3. If true, follow true branch. If false, follow else branch (OR do nothing if there is no else branch).

Subsection 3.8.2 Select-WE4-P1

Exercises Exercises

1.

Use this given setup for each of the questions below.

int alpha = 2, beta = 1, delta = 3, eta = 0, gamma = 0;
2.

Q12: After executing the following code, the value in variable gamma is and the value in variable eta is .

3.

Q13: After executing the following code, the value in variable gamma is and the value in variable eta is .

You have attempted of activities on this page.