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.

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