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
- With enough yes/no questions, you can figure out almost anything
- The best questions split possibilities in half (broad questions first, specific later)
- You can sort any group of objects using a chain of yes/no questions
20 Questions Strategy
| Good First Questions | Why 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
- Start at the top with the first question
- Answer yes or no
- Follow the matching branch down
- Answer the next question
- Keep going until you reach a final answer at the bottom
Decision Trees vs. Flowcharts
| Flowchart | Decision Tree |
| Usually one path from start to finish | Multiple branching paths |
| Shows steps in order | Shows choices and their outcomes |
| Everyone follows the same path | Different 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
| Block | What It Does | Category |
| if < > then | Checks a condition; runs inside blocks only if true | Control (yellow) |
| if < > then / else | Runs one set of blocks if true, another if false | Control (yellow) |
| forever | Keeps checking conditions over and over | Control (yellow) |
| key [ ] pressed? | Checks if a keyboard key is being pressed | Sensing (blue) |
| touching color [ ]? | Checks if the sprite is touching a color | Sensing (blue) |
| ask [ ] and wait | Asks the player to type an answer | Sensing (blue) |
| answer | Holds whatever the player typed | Sensing (blue) |
| ( ) = ( ) | Checks if two things are equal | Operators (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
- If/then rules = check a condition, then do an action
- If/then/else = handles both true and false
- Binary = two choices (yes/no, true/false)
- Yes/no questions = the building blocks of all decisions
- Decision trees = branching diagrams based on yes/no questions
- Conditionals in Scratch = if/then blocks that make sprites respond
- Forever + if/then = the pattern for checking conditions continuously