Putting It Together
Combining variables, decisions, loops, and input into one mini-program
Big Idea: A real program is not just one idea by itself. It is many small building blocks working together — a variable to remember, input to ask a question, a decision to choose, and a loop to repeat. When you snap them together, you can solve a whole problem!
By the end you will be able to:
- name the four building blocks and what each one does,
- explain what it means to "combine" them,
- read a small mini-program and follow how the blocks work together.
1. Your four building blocks (a quick recap)
You have already met four powerful ideas. On their own each one is small. Together they can build almost anything!
| Building block | What it does |
|---|---|
| Variable | A labelled box that remembers a value, like a score or a name. |
| Input | A way to ask the person for information, like a number or a word. |
| Decision | An if question that lets the program choose what to do next. |
| Loop | A way to repeat steps again and again without writing them many times. |
2. What does "combining" mean?
Combining means using more than one building block in the same program, so they help each other. One block passes its work to the next:
- Input asks the person a question, and stores the answer in a variable.
- A decision looks at that variable and chooses what to do.
- A loop can repeat the asking and choosing until the job is done.
One block is like one word. Combining blocks is like making a whole sentence — now you can say something real.