Imagine you want to bake a cake. Why is it important to follow the recipe step-by-step rather than doing everything at once?
Think about how mixing ingredients before baking affects the cake.
An algorithm must be step-by-step because each step builds on the previous one. Skipping or mixing steps can cause errors or wrong results.
Trace the steps of this algorithm that finds the sum of numbers from 1 to 3.
sum = 0 for number in [1, 2, 3]: sum = sum + number print(sum)
What is the output?
sum = 0 for number in [1, 2, 3]: sum = sum + number print(sum)
Add each number one by one to the sum.
The algorithm adds 1 + 2 + 3 step-by-step, resulting in 6.
Which of the following best explains why a step-by-step algorithm is better than trying to do everything at once?
Think about how breaking a big task into smaller steps helps avoid errors.
Step-by-step algorithms help manage complexity and reduce errors by handling one small task at a time.
Look at this flowchart describing an algorithm to find the largest number in a list:

Which step shows the decision point that ensures the algorithm works step-by-step?
Look for the step that compares values to update the result.
The decision to update max only if the current number is greater is the key step-by-step check that builds the correct answer.
You want to write an algorithm to sort three numbers from smallest to largest. Which step-by-step approach correctly sorts the numbers?
Think about how bubble sort compares and swaps neighbors step-by-step.
Option D describes a simple step-by-step sorting method that compares and swaps pairs to order the numbers correctly.