3.3 if-else Statements
Enduring Understanding
Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values.
Learning Objective
Represent branching logical processes by using conditional statements.
Essential Knowledge
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.
Last updated
Was this helpful?