Variables Conditionals and Loops
Grade 8 | Computer Science | Unit 01
Teacher's Guide
Learning objectives
- Explain the central ideas of variables conditionals and loops using appropriate vocabulary.
- Apply the worked example and justify answers to the practice questions.
- Complete the investigation or design task and identify a limitation of its model or evidence.
Prerequisites: Computer input/output concepts and basic algorithms.
Suggested time: Two or three 45-minute sessions; extend the activity when needed.
Teaching sequence
- Elicit a prior explanation of the topic and note uncertain vocabulary.
- Discuss the concept section, distinguishing observations, models, and assumptions.
- Work through the example. Ask students to explain each step and check any units.
- Complete the activity, then use the five practice questions as an individual check.
- Review the two vocabulary questions and revisit misconceptions revealed by the answers.
Assessment and differentiation
Use the seven questions in the companion CSV for retrieval practice or a short quiz. Award one point per entry for an accurate answer; accept scientifically equivalent wording. Treat five correct answers as a suggested checkpoint for further review, with both reasoning and activity quality assessed separately. Support students with a labeled diagram, a word bank, or a completed first step. Extend by asking students to change one example condition, predict the effect, and explain a limitation.
Student Worksheet
Concept and helping material
A variable stores a value that can change during a program. Conditional statements choose actions based on Boolean tests. Loops repeat instructions, reducing duplication. A counted loop runs a specified number of iterations; a condition-controlled loop repeats while its condition remains true. A loop needs appropriate updates so it can terminate when intended. Procedures package reusable actions. Trace tables show the value of variables after each step and help uncover mistakes. In simulations, clearly distinguish a variable representing measured data from one storing a modeling assumption.
Vocabulary
- Boolean: A value that is either true or false.
- Iteration: One execution of a loops repeated instructions.
Worked example
Start score at 0 and repeat score = score + 2 three times. The successive scores are 2, 4, and 6. A condition score >= 5 becomes true after the third update.
Investigation or design task
Complete a trace table for the example. Write pseudocode for adding five readings and reporting their mean, then test it using a list of known values.
Practice
- What is score after adding 2 three times from 0?
- Is score >= 5 true when score is 4?
- Why use a loop instead of copying the same instruction many times?
- What can cause an unintended infinite while loop?
- What is a procedure useful for?
Vocabulary retrieval
- Define Boolean.
- Define Iteration.
Reflection
Explain which evidence, calculation, or model supports one of your answers. State a condition under which your explanation might need revision.
Answer Key
- False.
- It reduces repetition and makes consistent changes easier.
- Its condition never becomes false because a needed update is missing or incorrect.
- Reusing a named set of instructions.
Vocabulary definitions appear above and are also included in the CSV. Activity answers may vary; require a clear method or design, correct use of lesson concepts, and an explicit limitation. Reflection is assessed for reasoning rather than one fixed phrase.
Source Reference
Everything You Need to Ace Computer Science and Coding in One Big Fat Notebook, PDF viewer pages 159-210,258-320 (1-based). Page numbers refer to this supplied file and may differ from printed page numbers. The source is background reading for the grouped topic. Lesson explanations, examples, and questions are original teaching material; they do not reproduce the book's worksheets or illustrations.