Computational Thinking: Unit Exam B
Algorithms and decomposition, a while loop to trace, flowchart symbols in use, abstraction, and choosing normal, boundary and erroneous test data.
Instructions
- Time allowed
- 25 minutes
- Total marks
- 25
- Calculator
- No calculator is permitted.
- Answer all the questions.
- The number of marks for each question is shown in brackets. Use it as a guide to how much to write.
- The clock at the top counts down from the real time allowed. When it reaches zero the paper is locked and marked, as it would be collected in the exam hall.
- Read every question to the end before answering. Where a question says tick two boxes, tick exactly two: ticking more than asked scores nothing. Type one word and number answers carefully, because they are marked exactly.
Questions
Answer every question, then finish the paper to have it marked. Marking as you go teaches you far less.
Tick one box.
- LB A precise sequence of steps that solves a problem
An algorithm is the steps; a program is one way of writing them for a computer.
Tick one box.
- LD Decomposition
Breaking one task into parts is decomposition.
x = 1
while x < 20
x = x * 3
endwhile
print(x)| Pass | x |
|---|---|
| Start | 1 |
| 1 | |
| 2 | |
| 3 |
- L3
- L9
- L27
x is 1, then 3, then 9. 9 is still below 20, so the loop runs again and x becomes 27, which ends the loop.
- L27
The loop stops once x is 27, so 27 is printed.
| Start or end | Process | Decision | Input or output | |
|---|---|---|---|---|
| INPUT name | ||||
| Is the score above 50? | ||||
| total = total + 1 | ||||
| Start |
Tick one box in each row.
- LINPUT name: Input or output
- LIs the score above 50?: Decision
- Ltotal = total + 1: Process
- LStart: Start or end
Inputs and outputs are parallelograms, questions are diamonds, calculations are rectangles and Start is a rounded rectangle.
- LRemoving or hiding details that are not needed, to focus on what matters
- LA valid example, such as a map leaving out buildings or a game character stored as just its position and health
Abstraction means removing the details that do not matter to the problem, so you can focus on those that do. A sat nav map, for example, shows roads and junctions but leaves out buildings, trees and the colour of cars.
| Normal | Boundary | Erroneous | |
|---|---|---|---|
| 0 | |||
| 57 | |||
| 100 | |||
| hello |
Tick one box in each row.
- L0: Boundary
- L57: Normal
- L100: Boundary
- Lhello: Erroneous
0 and 100 are the edges of the range, 57 is an ordinary valid value, and hello is the wrong type of data.
a = 7
b = 3
if a > b then
c = a - b
else
c = b - a
endif
print(c * 2)- L8
7 > 3, so c = 7 - 3 = 4, and 4 x 2 = 8.
Tick one box.
- LC It shows the order of the steps and the decisions visually, so it is easy to follow
A flowchart shows the flow of control at a glance.
- LNormal: a password comfortably over 8 characters, such as 12 characters
- LBoundary: exactly 8 characters (or 7, just outside)
- LErroneous: a password that should be rejected, such as 3 characters or nothing at all
Normal: a 12 character password such as greenbike2025, which should be accepted. Boundary: exactly 8 characters, such as abcd1234, which is on the edge and should be accepted. Erroneous: a 3 character password such as abc, or nothing at all, which should be rejected.
Tick one box.
- LA Memorisation
The techniques are decomposition, abstraction, pattern recognition and algorithmic thinking.
Tick one box.
- LD Set largest to the first number in the list
Start with the first number as the largest so far, then compare it with each of the others.
for i = 1 to 5
print("Hello")
next i- L5
i takes the values 1, 2, 3, 4 and 5.
for i = 2 to 10 step 2
print(i)
next i- L5
i takes the values 2, 4, 6, 8 and 10: five times.
This is an original Key Stage 3 assessment. Most questions are closed, so the marking is exact, and the written answers are marked against a mark scheme in the same style as a GCSE paper, so the format is familiar long before it counts.