OCR GCSE Computer Science Paper 2, June 2025: question 5

A PrepWise guide to a real paper, with our descriptions and answers. Not made or approved by OCR.

PrepWise guide: OCR GCSE Computer Science Paper 2Question 55 of 6

An online payment checker takes three inputs. A is true if the password typed is right, B is true if the PIN typed is right, and C is true if the card has been blocked. Output P is true when the user passes either check and the card is not blocked. In 05.4 no check that the digits are numeric is needed.

Figure 7
An empty frame for a logic circuit: three inputs A, B and C on the left, an empty area in the middle and the output P on the right.Open full size to read the labels (Figure 7, opens in a new tab)
Figure 8
A truth table with columns A, B and P and four empty rows.Open full size to read the labels (Figure 8, opens in a new tab)
Figure 9
Three technique boxes on the left and four example boxes on the right.Open full size to read the labels (Figure 9, opens in a new tab)
05.1[3 marks]

Draw the logic circuit in Figure 7 that gives output P from inputs A, B and C.

See how you would score on Logic Gates

Our own questions on this topic, marked straight away, so you see what to revise. Free now.

Show model answer for 05.1Hide model answer for 05.1
P = (A OR B) AND NOT C
Answer for 05.1
A completed logic circuit with three gates and wires from inputs A, B and C to output P.Open full size to read the labels (Answer for 05.1, opens in a new tab)
3 marks

How the marks are earned

  1. One mark for each point, up to 3.
  2. BP1: an OR gate that has two inputs. Any OR gate with two inputs is credited.
  3. BP2: a NOT gate on input C.
  4. BP3: the OR gate output and the NOT gate output joined by an AND gate. This mark can follow through where sensible, for example if a NOT gate is missing or wrong, or the wrong gate was used instead of OR.
  5. Gate shapes must be correct: a NOT gate has a small circle, and AND and OR gates have no circle.
  6. A maximum of 2 marks if there are extra gates or the circuit does not work logically.

Why it scores

The drawn circuit written as one Boolean expression: A and B go into an OR gate, because either the password or the PIN is enough. C goes through a NOT gate, because the card must not be blocked. An AND gate needs both results to be true.

Revise Logic Gates
05.2[2 marks]

Complete the truth table in Figure 8 for the output P of an AND gate with inputs A and B.

See how you would score on Truth Tables
Show model answer for 05.2Hide model answer for 05.2
A  B  P
0  0  0
0  1  0
1  0  0
1  1  1
2 marks

How the marks are earned

  1. One mark for all four combinations of A and B: 00, 01, 10 and 11. They need not be in order.
  2. One mark for the P column: 1 for the one row where both inputs are 1, and 0 for the remaining three rows.
  3. T and F, yes and no, or ticks and crosses are credited in place of 1 and 0.

Why it scores

Two inputs give four combinations. AND is only true when both inputs are true, so only the last row has P = 1.

Revise Truth Tables
05.3[3 marks]

Draw one line from each technique in Figure 9 to its correct example.

See how you would score on Computational Thinking
Abstraction
Decomposition
Algorithmic thinking
Show model answer for 05.3Hide model answer for 05.3

Abstraction to the third example

Decomposition to the first example

Algorithmic thinking to the fourth example

Answer for 05.3
The matching figure again, with a line drawn from each technique box to one example box.Open full size to read the labels (Answer for 05.3, opens in a new tab)
3 marks

How the marks are earned

  1. One mark for each correct link, up to 3. A technique with more than one link earns nothing for it.
  2. Abstraction is linked to the third example box.
  3. Decomposition is linked to the first example box.
  4. Algorithmic thinking is linked to the bottom example box.

Why it scores

Abstraction keeps only the details that matter, here identity, PIN and password, and ignores all other data.

Decomposition splits a big problem into smaller parts, here a security module and a payments module.

Algorithmic thinking plans a step by step process, here the steps a user follows to pay safely. The second example, more RAM, is not a thinking technique at all.

Revise Computational Thinking
05.4[6 marks]

Create an algorithm that reads the PIN typed in as a string, printing VALID PIN for four characters not 1234 or 4321, else INVALID PIN.

See how you would score on Input Validation
Show model answer for 05.4Hide model answer for 05.4
pin = input("Enter PIN")
if pin.length == 4 AND pin != "1234" AND pin != "4321" then
    print("VALID PIN")
else
    print("INVALID PIN")
endif
6 marks

How the marks are earned

  1. One mark for each point, up to 6. This is Section A, so pseudocode, structured English or a flowchart can score, but the answer must not just repeat the question.
  2. BP1: the PIN is taken as input and stored or used.
  3. BP2: an attempt at selection, or at a condition controlled loop.
  4. BP3: a correct check that the PIN has 4 characters.
  5. BP4: a correct check that the PIN is not 1234 and not 4321. BP3 and BP4 may be one combined check, if it works, or two separate checks, and either may test for the good case or the bad case. Each comparison, with 1234 and with 4321, must name the variable.
  6. BP5: every invalid PIN produces INVALID PIN (once or several times), provided all three checks were sensibly attempted, even if VALID PIN is printed as well. A sensible but wrong attempt at BP3 and BP4 still counts.
  7. BP6: provided all three checks were sensibly attempted, VALID PIN is printed only for a fully valid PIN, with no contradictory output such as INVALID PIN as well. A sensible but wrong attempt at BP3 and BP4 still counts.
  8. & for AND, and | or || for OR, are accepted.
  9. Taking in or comparing the PIN as an integer gets benefit of the doubt. No quotation marks are needed round 1234 or 4321. Equivalent output messages are credited.
  10. A flowchart is read by its text and not its shapes.

Why it scores

The PIN is stored, then one if statement tests all three rules together. AND means every rule must pass, so VALID PIN is printed only for a good PIN. The else branch prints INVALID PIN for everything else, so the two messages never appear together.

Revise Input Validation
OCR owns the copyright in its exam questions, so we cannot copy their wording. These descriptions and answers are ours. Not made or approved by OCR.[14 marks]