Loops: Repeat the Steps

8 questions · 8 points · Grades 5–6 · English · Preview the 8 questions

Made by Aisha Varrick · LessonRally (AI-assisted)

Digital classroom activity

What is a digital classroom activity?

Teachers who sign in can assign LessonRally activities to their Google Classroom classes: students open them in Classroom and answer online, and their grades go to the teacher's Classroom gradebook. Practice lets you try it first, the way students see it.

Free for teachers. Sign in to assign activities to your Google Classroom classes.

Printable worksheet

Students trace loops written as plain-language steps: loops that repeat a set number of times, loops with two actions inside, a loop inside a loop, a loop to fix, and a repeat-until loop that stops when a check is met. Every trace ends in one exact number. Coding and computer science practice with no programming language.

Learning goal: Trace loops written as numbered steps, including counted, nested and repeat-until loops, to find the exact result, and fix a loop that gives the wrong result.

Estimated reading level 2.9

  1. KindergartenHard
  2. Grade 1Stretch
  3. Grade 2On level
  4. Grade 3Easier
  5. Grade 4Easy
About this estimate

The estimate is the middle score of five readability formulas. Their scores run from 1.5 to 5.9.

  • Flesch-Kincaid GradeSentence length and syllables per word2.6
  • Gunning FogSentence length and words of three or more syllables4.9
  • Coleman-Liau Middle scoreLetters per word and sentences per 100 words2.9
  • Automated Readability IndexCharacters per word and words per sentence1.5
  • SMOGWords of three or more syllables, for texts of 30 sentences or more5.9
Flesch Reading Ease
94.1 on a 0 to 100 scale where higher is easier: very easy. Not part of the estimate.
Text measured
494 words, 43 sentences

Adapted from common readability formulas (Flesch-Kincaid, Gunning Fog, Coleman-Liau and ARI, plus SMOG for long texts), which look at sentence length and word length. Answer choices count toward word length only. Grades below the estimate will likely find the text harder, grades above it easier. It does not measure ideas, background knowledge or images.

Topic: Programming and Algorithms Chosen by LessonRally

Question types: number answer, multiple choice.

Student preview

The questions as students see them, without the answers.

Every question includes a loop, which is a step that repeats. Before you trace, check exactly how many times each loop runs or what makes it stop, then follow the steps one at a time.

Question 1

At a school carnival, a ring-toss game uses these steps to work out how many prize tickets a player earns.

  1. Set tickets to 7.
  2. Repeat 5 times: add 6 to tickets.
  3. Subtract 9 from tickets.

What is the value of tickets after the game finishes step 3?

Enter a number.

Question 2

Arjun wrote a program in which the same step, adding 3 to score, appears five times in a row.

  1. Add 3 to score.
  2. Add 3 to score.
  3. Add 3 to score.
  4. Add 3 to score.
  5. Add 3 to score.

Which single loop step does exactly the same thing as these five steps?

Choose one answer.

  • Repeat 3 times: add 15 to score.
  • Repeat 5 times: add 5 to score.
  • Repeat 5 times: add 3 to score.
  • Repeat 3 times: add 3 to score.

Question 3

A science game uses these steps as a simple model of how a small group of cells grows during an experiment.

  1. Set cells to 3.
  2. Repeat 4 times: double cells.
  3. Subtract 8 from cells.

What is the value of cells after the game finishes step 3?

Enter a number.

Question 4

Talia designed a pattern program for her art class, and it follows these steps.

  1. Set size to 2.
  2. Repeat 4 times, doing both actions each time: double size, then subtract 1 from size.

What is the value of size after the loop in step 2 is finished?

Enter a number.

Question 5

A robot dancer performs a short routine by following these steps. Before the routine begins, the robot has not done any claps or spins.

  1. Repeat these moves 3 times: clap 4 times in a row, then spin once.

How many claps and spins does the robot do in all?

Enter a number.

Question 6

Zoe is programming a holiday light display. She wants these steps to end with lights equal to 20, but they end with 24 instead.

  1. Set lights to 4.
  2. Repeat 5 times: add 4 to lights.

Which change makes the steps end with 20?

Choose one answer.

  • Change step 2 to add 5 each time.
  • Change step 2 to repeat 6 times.
  • Change step 1 to set lights to 8.
  • Change step 2 to repeat 4 times.

Question 7

These steps use two variables, total and count, that change as the loop runs. In these steps, "Add count to total" changes only total.

  1. Set total to 0.
  2. Set count to 1.
  3. Repeat 6 times, doing both actions each time: add count to total, then add 1 to count.

What is the value of total after the loop in step 3 is finished?

Enter a number.

Question 8

A rocket game fills a fuel tank with these steps. Step 2 checks fuel before every round, so the loop stops as soon as fuel is 20 or more.

  1. Set fuel to 3.
  2. Repeat until fuel is 20 or more: add 5 to fuel.

How many times does step 2 add 5 to fuel?

Enter a number.

Reviews

No reviews yet.

Reviews come from teachers who assigned this activity to a class.

Sign in to write a review

Have a topic of your own? Make a printable worksheet and online quiz, free.

Create an activity

Answer key

Answer keys come with Premium

Print this worksheet with the correct answers marked. The key includes any explanations, sample answers, and rubrics supplied with the activity.

Answer keys aren't public: only teachers with Premium and the people who can edit an activity can download one, so students can't get a ready-to-print key from this page.

Premium includes:

  • No ads for you, and no ads for your students on the assignments you post.
  • Answer keys for printable worksheets, with the correct answers marked and any explanations, sample answers, and rubrics.
  • Create with AI: up to 100 activities a year (5 during the free trial), with every answer checked before you see the draft.

$29 a year, plus sales tax where it applies.

New Premium teachers can try it free for 7 days. A card or other payment method is needed to start. Unless you cancel before the trial ends, you are charged then and the plan renews every year.

Already have Premium or edit this activity? Sign in