Grade 6 Computer Science — What is an algorithm?
Follow an algorithm step by step to find what it produces, and explain why changing the order of the steps changes the answer.
Name: ________________________
1.Those two algorithms use the same starting number and the same two steps, but end differently. Why?
- a) Because the steps were done in a different order
- b) Because one of the two must be wrong
- c) Because 4 is an even number
- d) Because doubling is not allowed twice
2.An algorithm says: start with 2, then multiply it by 5, then add 1. What number do you end with?
3.Some steps just do something. Others ask a question first and go one way or the other. Sort each step.
Groups: Just does something · Asks a question first
- Show the answer on the screen
- If the answer is right, say well done
- Add 5 to the total
- If the box is empty, fill it
- If the total is over 20, stop
- Double the number
4.Why must every algorithm come to an end?
- a) Because the screen would run out of room
- b) Because computers can only hold ten steps at a time
- c) Because a set of steps that never finishes never gives an answer
- d) Because every algorithm must have exactly five steps
5.Put these steps in the order a computer runs them to add two numbers and show the total.
- Add the two numbers together
- Read the two numbers
- Show the total on the screen
6.Which of these describes an algorithm best?
- a) A picture of what a program will look like
- b) Another name for the keyboard
- c) A machine that runs inside the computer
- d) A list of clear steps, in order, that finishes the job
7.An algorithm says: start with 20, then halve it, then take away 3. What number do you end with?
8.An algorithm says: start with 12, then halve it, then halve it. What number do you end with?
Answer key — Grade 6 Computer Science — What is an algorithm?
- 1. a) Because the steps were done in a different order
- 2. 11
- 3. Add 5 to the total → Just does something; If the total is over 20, stop → Asks a question first; Show the answer on the screen → Just does something; If the box is empty, fill it → Asks a question first; Double the number → Just does something; If the answer is right, say well done → Asks a question first
- 4. c) Because a set of steps that never finishes never gives an answer
- 5. 1. Read the two numbers 2. Add the two numbers together 3. Show the total on the screen
- 6. d) A list of clear steps, in order, that finishes the job
- 7. 7
- 8. 3