Grade 6 · lesson 1 of 4

Follow a repeated instruction

Trace a loop by keeping a clear record of changing values.

Download the grade pack

Supplied materials

  • Pseudocode means instructions expressed in readable words; no software is required.
  • Supplied rule: set total to 1. Repeat exactly 3 times: add 2 to total. After all repetitions, show total.

Learn the idea

A loop repeats a stated set of instructions. The starting value is set before the loop; each repetition uses the value left by the previous one.

A trace table records the state after each step. It helps distinguish the number of repetitions from the amount added. Showing the answer after the loop is different from resetting the total inside it.

  1. Make columns named repetition and total.
  2. Record total = 1 before any repetition.
  3. Add 2 once for each of the three repetitions.
  4. Change the repeat count to four and trace it again.
Worked example

See the method in action

Before the loop total is 1. After repetitions 1, 2 and 3 it is 3, 5 and 7. The shown answer is 7; the loop added 2 three times.

Your turn

Check your reasoning

Your answer is temporary and is not saved to an account. Download your current answer before leaving or reloading. Written work on paper or in another app stays in your own file.

With the same starting value and instruction, what is shown after 4 repetitions?

Feedback appears here after you check. This is practice, not a graded school assessment.

See the answer and explanation

9

The trace is 1 → 3 → 5 → 7 → 9. Four additions of 2 contribute 8, and the starting 1 is still included.

Take it further

Move “set total to 1” inside the loop, just before “add 2.” Explain why the final value then becomes 3.

Nothing here is saved to an account or sent to a teacher. The answer download includes your current choice and any checked feedback.

Longer courses for learners ages 14+

These related courses have their own preparation and projects. They are not early-grade assignments.

Check the subject sources

These LifeStarter passages, scenarios and exercises are authored for this Academy with AI assistance and review. External resources keep their publishers’ terms. A grade label suggests a starting level; it does not establish alignment with your school’s complete requirements.