U5Ch1L7_IfStatementsUnplugged

Purpose: Students will begin writing code using If Statements.

Vocabulary:

Class Question:
Handout:
 With a partner discuss what the difference is between them:
Set #A

Take a moment to discuss with your partner the difference between the two sentences.

Set #B

Take a moment to discuss with your partner the difference between the two sentences.
What is the difference between “When” & “If”??
There is no right answer. In English both pairs of sentences mean basically the same thing.
However in programming, using the words "if" and "when" map to some expectations about how the underlying code is written.
Here is the difference:
"When" is used in reference to an event -- When something happens respond in such and such a way.
"If" is used in reference to a decision about whether or not to execute a certain piece of code -- If something is true, then do this, otherwise do that.

Code Studio