Please enable JavaScript to use CodeHS

AP CSA: CON-2.A.4

CodeHS Lessons

A two-way selection is written when there are two sets of statements—one to be executed when the Boolean condition is true, and another set for when the Boolean condition is false. In this case, the body of the “if” is executed when the Boolean condition is true, and the body of the “else” is executed when the Boolean condition is false.

1.13 If/Else Statements
9.3 if-else Statements
1.13 If/Else Statements
9.3 if-else Statements
3.3 if-else Statements
3.12 If/Else Statements
4.12 If Statements
1.12 If/Else Statements
2.11 If Statements