Time left25:00 Answered 0 of 14 25 marks
MskProd Year 8 unit exam 25 minutes 25 marks Unit exam

Computational Thinking: Unit Exam B

Instructions

Time allowed
25 minutes
Total marks
25
Calculator
No calculator is permitted.
  • Answer all the questions.

Questions

25 marks
1What is an algorithm?1 mark

Tick one box.

Mark scheme0 / 1
  • LB A precise sequence of steps that solves a problem
Model answer

An algorithm is the steps; a program is one way of writing them for a computer.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

2Planning a school trip is broken down into transport, food, permission letters and a timetable. Which technique is this?1 mark

Tick one box.

Mark scheme0 / 1
  • LD Decomposition
Model answer

Breaking one task into parts is decomposition.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

3(a)Complete the trace table for this algorithm.3 marks
OCR reference language
x = 1
while x < 20
    x = x * 3
endwhile
print(x)
Passx
Start1
1
2
3

Mark scheme0 / 3
  • L3
  • L9
  • L27
Model answer

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.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

3(b)What does the algorithm output?1 mark

Mark scheme0 / 1
  • L27
Model answer

The loop stops once x is 27, so 27 is printed.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

4Tick one box in each row to show which flowchart shape each step should be drawn in.4 marks
Start or endProcessDecisionInput or output
INPUT name
Is the score above 50?
total = total + 1
Start

Tick one box in each row.

Mark scheme0 / 4
  • LINPUT name: Input or output
  • LIs the score above 50?: Decision
  • Ltotal = total + 1: Process
  • LStart: Start or end
Model answer

Inputs and outputs are parallelograms, questions are diamonds, calculations are rectangles and Start is a rounded rectangle.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

5Explain what abstraction means. Give an example in your answer.2 marks
Explain

Mark scheme0 / 2
  • 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
Model answer

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.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.

Think this answer or mark scheme is wrong? Report it

6A program accepts a test score from 0 to 100. Tick one box in each row to show the type of each test value.4 marks
NormalBoundaryErroneous
0
57
100
hello

Tick one box in each row.

Mark scheme0 / 4
  • L0: Boundary
  • L57: Normal
  • L100: Boundary
  • Lhello: Erroneous
Model answer

0 and 100 are the edges of the range, 57 is an ordinary valid value, and hello is the wrong type of data.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

7What does this algorithm output?1 mark
OCR reference language
a = 7
b = 3
if a > b then
    c = a - b
else
    c = b - a
endif
print(c * 2)

Mark scheme0 / 1
  • L8
Model answer

7 > 3, so c = 7 - 3 = 4, and 4 x 2 = 8.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

8What is the main advantage of a flowchart over a paragraph of instructions?1 mark

Tick one box.

Mark scheme0 / 1
  • LC It shows the order of the steps and the decisions visually, so it is easy to follow
Model answer

A flowchart shows the flow of control at a glance.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

9A program checks that a new password is at least 8 characters long. Give one example of each type of test data you would use: normal, boundary and erroneous.3 marks
Give

Mark scheme0 / 3
  • 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
Model answer

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.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.

Think this answer or mark scheme is wrong? Report it

10Which of these is not a computational thinking technique?1 mark

Tick one box.

Mark scheme0 / 1
  • LA Memorisation
Model answer

The techniques are decomposition, abstraction, pattern recognition and algorithmic thinking.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

11An algorithm finds the largest number in a list. Which step comes first?1 mark

Tick one box.

Mark scheme0 / 1
  • LD Set largest to the first number in the list
Model answer

Start with the first number as the largest so far, then compare it with each of the others.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

12How many times does this loop print Hello?1 mark
OCR reference language
for i = 1 to 5
    print("Hello")
next i

Mark scheme0 / 1
  • L5
Model answer

i takes the values 1, 2, 3, 4 and 5.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

13How many times does this loop run?1 mark
OCR reference language
for i = 2 to 10 step 2
    print(i)
next i

Mark scheme0 / 1
  • L5
Model answer

i takes the values 2, 4, 6, 8 and 10: five times.

Marked exactly against the mark scheme. Change it only if an examiner would accept your answer.

Think this answer or mark scheme is wrong? Report it

Machine mark 0 / 25