Computational Thinking: Unit Exam A
Decomposition, abstraction, pattern recognition and algorithms, flowchart symbols, pseudocode, trace tables and 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.
| Decomposition | Abstraction | Pattern recognition | Algorithm design | |
|---|---|---|---|---|
| Breaking a big problem into smaller problems | ||||
| Removing details that are not needed | ||||
| Spotting what is the same in different problems | ||||
| Writing the steps that solve the problem |
Tick one box in each row.
- LBreaking a big problem into smaller problems: Decomposition
- LRemoving details that are not needed: Abstraction
- LSpotting what is the same in different problems: Pattern recognition
- LWriting the steps that solve the problem: Algorithm design
Decomposition breaks down, abstraction removes detail, pattern recognition spots similarities and algorithm design writes the steps.
Tick one box.
- LD Abstraction
The map keeps only what a passenger needs, the order of stations and the lines, so it is abstraction.
| Start or end | Process | Decision | Input or output | |
|---|---|---|---|---|
| Rounded rectangle | ||||
| Rectangle | ||||
| Diamond | ||||
| Parallelogram |
Tick one box in each row.
- LRounded rectangle: Start or end
- LRectangle: Process
- LDiamond: Decision
- LParallelogram: Input or output
Rounded rectangle for start and end, rectangle for a process, diamond for a decision and parallelogram for input or output.
Tick one box.
- LB 2
A decision has two exits, one for yes and one for no.
total = 0
for i = 1 to 4
total = total + i
next i
print(total)| i | total |
|---|---|
| 1 | |
| 2 | |
| 3 | |
| 4 |
- L1
- L3
- L6
- L10
total goes 0 + 1 = 1, then 1 + 2 = 3, then 3 + 3 = 6, then 6 + 4 = 10.
- L10
After the loop total is 10, which is printed.
| Normal | Boundary | Erroneous | |
|---|---|---|---|
| 13 | |||
| 16 | |||
| abc | |||
| 11 |
Tick one box in each row.
- L13: Normal
- L16: Boundary
- Labc: Erroneous
- L11: Boundary
13 is an ordinary valid value, 11 and 16 are at the edges of the range, and abc is the wrong type of data.
Tick one box.
- LC A way of writing an algorithm in structured English that looks like code but is not a real language
Pseudocode sets out the logic without worrying about any one language's rules.
- LSmaller problems are easier to understand and solve
- LParts can be shared out, worked on separately and tested on their own
Breaking a game into parts, such as the player, the enemies, the scoring and the menu, turns one overwhelming problem into small ones that are each easy to solve. The parts can also be shared out within a team and tested separately.
age = input("Age: ")
if age >= 12 then
print("Allowed")
else
print("Too young")
endif- LAllowed
12 >= 12 is true, so Allowed is output.
- LIt records the values of the variables, step by step, as an algorithm runs
- LTo check what the algorithm outputs or to find errors in it
A trace table records the value of every variable after each step as you work through an algorithm by hand. It shows exactly what the algorithm does and outputs, which makes errors easy to find.
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.