Computer Science
Grade 5
20 min
Step-by-Step Activities
Step-by-Step Activities
Tutorial Preview
1
Introduction & Learning Objectives
Learning Objectives
Decompose a complex problem into a sequence of smaller, logical steps.
Write a multi-step algorithm using loops with variables and conditional statements.
Trace the execution of an algorithm step-by-step to predict its outcome.
Identify and correct logical errors (bugs) in a given sequence of steps.
Translate a real-world task, like a game's rules, into a precise, step-by-step computer program.
Use binary numbers within a simple step-by-step activity.
Explain why the order of steps is critical for an algorithm to work correctly.
Ever wonder how a video game character knows exactly what to do when you press a button? 🎮 It's all about following a perfect list of step-by-step instructions!
In this lesson, we'll become master instruction wr...
2
Key Concepts & Vocabulary
TermDefinitionExample
AlgorithmA list of step-by-step instructions to solve a problem or complete a task.The recipe for making a peanut butter and jelly sandwich is an algorithm.
DecompositionBreaking a big, complicated problem down into smaller, easier-to-solve parts.To build a LEGO castle, you first decompose the problem into: build the walls, build the towers, and build the gate.
SequenceThe specific order in which instructions are performed. Order matters!You must put on your socks *before* your shoes. That's a sequence.
Loop with a VariableAn instruction that tells a computer to repeat a set of steps, using a variable to keep track of which repetition it's on.To count from 1 to 10, a loop could use a variable called 'count' that increases by one each time it repea...
3
Core Syntax & Patterns
The Loop with a Counter Pattern
SET counter TO 0. REPEAT UNTIL counter = [number]. DO [action]. CHANGE counter BY 1.
Use this when you need to repeat an action a specific number of times. The 'counter' variable keeps track of how many times you've looped.
The Complex Conditional (If/Else If/Else) Pattern
IF [condition A] is true, DO [action A]. ELSE IF [condition B] is true, DO [action B]. ELSE, DO [default action].
Use this to make decisions with more than two choices. The computer checks each condition in order until it finds one that is true.
The Nested Structure Pattern
LOOP 5 TIMES: IF [condition] is true, DO [action 1]. ELSE, DO [action 2].
You can put conditionals inside loops (or loops inside conditionals!). This lets you make decisions on ever...
4 more steps in this tutorial
Sign up free to access the complete tutorial with worked examples and practice.
Sign Up Free to ContinueSample Practice Questions
Challenging
In binary addition, what is the result of 101 + 010?
A.110
B.100
C.111
D.1010
Challenging
A variable 'power' starts at 1. A loop runs 4 times. Inside the loop: 'Multiply power by 2. IF power > 10, stop the loop.' What is the final value of 'power' when the program ends?
A.16
B.8
C.4
D.32
Challenging
A program draws a staircase with 10 steps. The code is: 'REPEAT 10 times: { Move Right, Move Up }'. To make the program more efficient and draw a staircase of ANY size, what is the best change?
A.Use two separate loops, one for moving right and one for moving up.
B.Create a variable 'numberOfSteps' and change the code to 'REPEAT numberOfSteps times'.
C.Write the 'Move Right, Move Up' commands out 100 times to be safe.
D.Add a conditional inside the loop.
Want to practice and check your answers?
Sign up to access all questions with instant feedback, explanations, and progress tracking.
Start Practicing Free