U4Ch1L6_ Conditionals Investigate

Purpose: Students will write If/Then statements and leran how to apply them in a program.

!Note!“When” = onEvent ;  “If” =The program does something "if" a boolean expression evaluates to true.

Journal:


Activity 1: Read the Provided Code and Predict the Outcome: A, B, C, D.


Video: Conditionals Part 2a - "If Statements"

Activity 2:   Program Game so that it ends when the player has ‘0’ Lives.

Play the Lemon Squeeze Game.

Do This: Fix the game so that it ends when the player has “0” lives.


Video: Conditionals Part 2b - "If/Else Statements"

Activity 3: "Mod Operator %" - Is There An Exact Number Of Cups Or A Remainder
Play the Lemon Squeeze Game.
What is different about the end of the Game?
(When the game ends, it states on a small screen if the lemons collected is exact or has a remainder.

Do This: Rewrite the code.


Video: Conditionals Part 2c - "If/Else If Statements"

Activity 4- “If/Else/If Statements." As the Score Increases, the Lemon Will Become Smaller .
Play The Game. What is different about the end of the Game?
(As the score increases, the lemons become smaller.)

Do This:

Journal: Explain why the program begins with ‘score >15’, then 10, then 5 and current size, instead of starting with the lower score that is achieved first by the user - ‘score >’5’, then 10, then 15? If you are not sure, then try it and see what happens.
Explanation of why you want to keep the "Most Specific Case" (larger number) first.


Video: Conditionals Part 3 - And & Or Operators

Activity 5: 'And' & 'Or' Operators:  Add a Username and Password.
Play The Game.
What is different about the Game?
( Must enter Username and Password in order to play.)
Do This: