Class 6 Computer Science — Following a flowchart
Trace a flowchart from start to stop, take the right arrow out of a decision, and say what it prints.
Name: ________________________
1.A flowchart sets a total to 0. Each time round it adds 5 to the total, and it goes round 4 times. What is the total at the end?
2.A flowchart sets a counter to 0. Each time round it adds 1 to the counter, then asks whether the counter is 6. If the answer is No it goes round again. How many times does it add 1 before it stops?
3.A flowchart reads a number, doubles it and prints it. Put the boxes in the order they are visited.
- Double the number
- Read the number
- Print the result
- Stop
- Start
4.A flowchart sets a total to 0. Each time round it adds 3 to the total, and it goes round 7 times. What is the total at the end?
5.What would go wrong if one arrow out of a decision diamond led nowhere?
- a) Anyone following that answer would be stuck with no next step
- b) The other arrow would stop working too
- c) The flowchart would run twice as fast
- d) Nothing — a diamond only ever needs one arrow
6.A flowchart reads a number. If the number is more than 10, it prints "Big". If not, it prints "Small". The number read is 7. What does the flowchart print?
7.A flowchart reads a number. If the number is more than 10, it prints "Big". If not, it prints "Small". The number read is 15. What does the flowchart print?
8.A flowchart reads a number. If the number is more than 20, it prints "Big". If not, it prints "Small". The number read is 44. Which arrow out of the diamond is taken?
- a) The Yes arrow
- b) Neither of them
- c) The No arrow
- d) Both of them
Answer key — Class 6 Computer Science — Following a flowchart
- 1. 20
- 2. 6
- 3. 1. Start 2. Read the number 3. Double the number 4. Print the result 5. Stop
- 4. 21
- 5. a) Anyone following that answer would be stuck with no next step
- 6. Small
- 7. Big
- 8. a) The Yes arrow