Skip to content

Putting It Together: Combining the Building Blocks

Beginning of the lesson

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 blockWhat it does
VariableA labelled box that remembers a value, like a score or a name.
InputA way to ask the person for information, like a number or a word.
DecisionAn if question that lets the program choose what to do next.
LoopA 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.

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 15
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers