Conditionals
Students will recreate a Model program that will teach them how to create nested If/Then/Else statements: Mobile / You Tube
Boolean - A general programming term that involves values that are only true or false.
Example: 5 > 3 (true) or 10 == 15 (false)
Conditionals - Conditionals are a type of Boolean Expressions. A Conditional makes a decision based on if a condition is met.
In short: the Boolean is the answer ("Is the stop light Red or Green" , and the Conditional is the decision made because of it ("If Green, Then Go. If Red, Then Stop.")if/then/ else _ Example
- if condition (Green) then
- consequence (Go)
- else
- alternative (Wait)
if/then/else if/else _ Example
- if condition (Green)1 then
- consequence (Go)
- else if condition2 (Arrow) then
- consequence (Turn)
- else
- alternative (Wait)