Conditionals: If, Then, Else

8 questions · 8 points · Grade 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 conditionals written as plain-language steps: if-then-else choices, a three-way choice, a condition checked inside a loop, and if steps in a row. They read each boundary carefully, including a case that lands right on it, and finish each trace with one number or one message. Coding and computer science practice with no programming language.

Learning goal: Trace if-then-else steps to find the exact result, read boundaries such as "10 or more" and "more than 14" correctly, and choose a condition that matches a rule.

Estimated reading level 3.8

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

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

  • Flesch-Kincaid Grade Middle scoreSentence length and syllables per word3.8
  • Gunning FogSentence length and words of three or more syllables6.4
  • Coleman-LiauLetters per word and sentences per 100 words3.7
  • Automated Readability IndexCharacters per word and words per sentence2.6
  • SMOGWords of three or more syllables, for texts of 30 sentences or more7.4
Flesch Reading Ease
88.4 on a 0 to 100 scale where higher is easier: easy. Not part of the estimate.
Text measured
560 words, 44 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.

In these steps, when a condition is true, the program does the then part, and when it is false, the program does the else part if there is one. Every condition is checked using the value that the variable has at that exact moment.

Question 1

A video game decides how many bonus points to give at the end of each level by following these steps.

  1. Set score to 12.
  2. If score is 10 or more, then add 5 to score. Else, add 1 to score.

What is the value of score after step 2 has finished?

Enter a number.

Question 2

A library app uses these steps to decide whether a borrowed book is overdue. The variable days counts how many days the book has been checked out.

  1. Set days to 14.
  2. If days is more than 14, then set fine to 1. Else, set fine to 0.

What is the value of fine after step 2 has finished?

Enter a number.

Question 3

A digital speed sign near an elementary school measures each passing car and decides which message to display to the driver by following these steps.

  1. Set speed to 35.
  2. If speed is 30 or less, then show the message Thanks. Else, show the message Slow Down.

Which message does the sign display?

Choose one answer.

  • Thanks
  • Both messages
  • Slow Down
  • No message

Question 4

A vocabulary quiz app awards each player stars at the end of a round by following these steps.

  1. Set points to 85.
  2. If points is 90 or more, then set stars to 3. Else, if points is 70 or more, then set stars to 2. Else, set stars to 1.

What is the value of stars after step 2 has finished?

Enter a number.

Question 5

A sorting robot in a factory examines these numbers one at a time, in this order: 3, 8, 5, 10, 2. Step 2 runs once for each of the 5 numbers.

  1. Set count to 0.
  2. For each number: if the number is more than 4, then add 1 to count.

What is the value of count after step 2 has checked every number?

Enter a number.

Question 6

Dana's teacher wants a program that displays Pass for every score of 60 and above, and Try Again for every score below 60. Which step does exactly that?

Choose one answer.

  • If score is more than 60, then show Pass. Else, show Try Again.
  • If score is 60, then show Pass. Else, show Try Again.
  • If score is less than 60, then show Pass. Else, show Try Again.
  • If score is 60 or more, then show Pass. Else, show Try Again.

Question 7

A packing program at an apple orchard uses these steps to decide how to fill paper bags with freshly picked apples.

  1. Set apples to 9.
  2. Set bags to 0.
  3. If apples is more than 5, then do both of these: add 2 to bags, then subtract 5 from apples. Else, add 1 to bags.

What is the value of apples after step 3 has finished?

Enter a number.

Question 8

A greenhouse heater program has three if steps in a row, and none of them has an else part. Each one checks temperature again, using the value temperature has when that step starts.

  1. Set temperature to 6.
  2. If temperature is less than 10, then add 5 to temperature.
  3. If temperature is less than 10, then add 5 to temperature.
  4. If temperature is more than 12, then subtract 3 from temperature.

What is the value of temperature after step 4 has finished?

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