Do you remember what an iteration is? Try this question.
Follow the algorithm below to fill in the results.
Step | Instruction | Result |
---|---|---|
1 | \text{Start with the number $29$} | ⬚ |
2 | \text{Subtract $1$ from this number} | ⬚ |
3 | \text{Repeat step $2$ three more times} | ⬚\\⬚\\⬚ |
4 | \text{Double the number} | ⬚ |
Iteration means to repeat steps in an algorithm.
This video shows us how to set up and follow a flow chart.
What is the output of this algorithm if the input is 4?
A linear sequence is a flow chart that moves from beginning to end in one straight line. There are no decisions, just a some steps to do.
We can show all our special coding things in a flow chart. This video shows us branches, loops and some special functions like print and set.
What is the output of this algorithm if the input is A=2 and B=5?
On a flow chart:
Branch is shown by two arrows coming out of a decision box.
Iteration is shown as a path that loops back to itself.
Print can be used to display an output.