ConceptStep · learning platform for computer science

Work with multiple variables

Scratch and algorithmic thinking · Lesson

Scratch · lesson 4 / 25

Work with multiple variables

Manage multiple independent memory cells and distinguish name, current value and new assignment.

1 · Explanation

The concept

A and B are independent memory cells. Changing A does not change B: each name identifies a distinct program state.

Mental model:

A = 4; B = 6

2 · Mind map

Build the concept in your mind

This is a starter map for the lesson concept. You can move and edit nodes, add new ones and create your own connections. Changes stay on this device and do not affect mastery assessment.

Key idea Pattern Scratch Common mistake Check

Double-click a node to edit it. Drag nodes and add the connections that help you remember the concept.

3 · Live example

Observe the behaviour

Press Run and focus on the Variables monitor: at this stage we deliberately do not use say yet. The lesson result is the new variable state, not Stage output.

Stage
Press Run to start the program.
Ready to run.
4 · Guided practice

Now build it yourself

Assign A=7 and B=3 while keeping the two memory cells independent; the observed value of B must be 3.

Guide:

The program contains a wrong assignment to B. Fix it and use Run: observe the result in the Variables monitor without adding say.

Progress: 0 / 5 · correct: 0

Stage
Press Run to test your program.
Run the program freely: local runs do not change your progress.

When you check the solution, ConceptStep automatically verifies the final state of B. The server probe is invisible and does not introduce output into this lesson.

5 · Algorithmic connection

From Scratch to flowchart and C

The mental model in this lesson does not belong to Scratch: it describes a programming concept. Later the same exercise can be represented as a flowchart and then as a C program while keeping the same test cases.

← Previous lesson Next lesson →
Your competency map

What you need to know for Work with multiple variables

ConceptStep separates what is required from what is recommended or useful as reinforcement. Only required prerequisites block your progress.

Current topic Strong skill Review due Needs reinforcement To be mastered Optional support

Relationships: solid line = required · dashed line = recommended · dotted line = reinforcement.

GUIDED LEARNING PATHS

Want to choose the next skill to develop?