Skip to main content

Section 3.13 Selection-WE6-P1

Subsection 3.13.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.13.2 Select-WE6-P1

Exercises Exercises

1.
2.
Use this given setup for each of the questions below.
int alpha = 2, beta = 1, delta = 3, eta = 0, gamma = 0;
double omega = 2.5, theta = -1.3, kappa = 3.0, lambda = 0.0, rho = 0.0;
3.
Q18: After executing the following code, the value in variable eta is .
4.
Q19: After executing the following code, the value in variable a is and the value in variable b is .
5.
Q20: After executing the following code, the value in variable x is and the value in variable y is .
You have attempted of activities on this page.