← Back to Module 4

Module 4: Making Decisions -- Study Guide

Lesson 1: If/Then Thinking

If/Then Rule -- A rule that says: "IF something is true, THEN do something." It has two parts: a condition (what you check) and an action (what you do).

Everyday Examples

IF it is raining, THEN take an umbrella.
IF you are hungry, THEN eat a snack.
IF the light is red, THEN stop and wait.
If/Then/Else -- Handles both possibilities. "IF something is true, THEN do this. ELSE (otherwise), do that instead."
Example: IF it is raining, THEN take an umbrella. ELSE wear sunglasses.
Key idea: Computers use if/then rules to make every decision. Without them, programs could only do the same thing every time.

Lesson 2: Yes/No Questions

Binary -- Two choices only: yes/no, true/false, on/off, 1/0. Computers think in binary. Every decision comes down to a yes/no question.

Why Yes/No Questions Are Powerful

20 Questions Strategy

Good First QuestionsWhy They Work
"Is it alive?"Splits everything into living and non-living
"Is it bigger than a cat?"Splits by size -- eliminates half
"Can you find it in a house?"Splits by location -- narrows fast
Key idea: The best yes/no questions narrow down the possibilities by cutting them in half. This is how computers search through information quickly.

Lesson 3: Decision Trees

Decision Tree -- A diagram that starts with one question at the top and branches out. Each branch leads to another question or a final answer. You follow the branches by answering yes or no.

How to Read a Decision Tree

  1. Start at the top with the first question
  2. Answer yes or no
  3. Follow the matching branch down
  4. Answer the next question
  5. Keep going until you reach a final answer at the bottom

Decision Trees vs. Flowcharts

FlowchartDecision Tree
Usually one path from start to finishMultiple branching paths
Shows steps in orderShows choices and their outcomes
Everyone follows the same pathDifferent answers lead to different results
Key idea: "Choose Your Own Adventure" stories are decision trees! Every choice creates a branch that leads to a different ending.

Lesson 4: Conditionals in Scratch

Conditional -- A coding instruction that checks a condition and only does something if that condition is true.

Important Scratch Blocks

BlockWhat It DoesCategory
if < > thenChecks a condition; runs inside blocks only if trueControl (yellow)
if < > then / elseRuns one set of blocks if true, another if falseControl (yellow)
foreverKeeps checking conditions over and overControl (yellow)
key [ ] pressed?Checks if a keyboard key is being pressedSensing (blue)
touching color [ ]?Checks if the sprite is touching a colorSensing (blue)
ask [ ] and waitAsks the player to type an answerSensing (blue)
answerHolds whatever the player typedSensing (blue)
( ) = ( )Checks if two things are equalOperators (green)

Key Pattern: Forever + If/Then

Put if/then blocks inside a "forever" loop so the program keeps checking conditions. Without the forever loop, Scratch checks only once.
Key idea: Conditionals make programs interactive. They let programs respond to what the user does, which is what makes games and apps work.

Big Ideas to Remember

  1. If/then rules = check a condition, then do an action
  2. If/then/else = handles both true and false
  3. Binary = two choices (yes/no, true/false)
  4. Yes/no questions = the building blocks of all decisions
  5. Decision trees = branching diagrams based on yes/no questions
  6. Conditionals in Scratch = if/then blocks that make sprites respond
  7. Forever + if/then = the pattern for checking conditions continuously