Question 5

OCR Computer Science June 2025 Computational thinking, algorithms and programming (J277-02)GCSE14 marks

On the specification

(a)
2.4 Boolean logic
(b)
2.4 Boolean logic
(c)
2.1 Algorithms
(d)
2.2 Programming fundamentals2.3 Producing robust programs
Question text

5 A security system protects online credit card payments. The system has three inputs: Input Description A True when the user enters their correct password B True when the user enters their correct PIN C True when the card is blocked The output (P) is True if both of the following conditions are True: • the user has entered either their correct password or has entered their correct PIN • the card is not blocked. (a) Draw the logic circuit for the security system A B P C [3] (b) Complete the truth table for P = A AND B A B P [2] (c) Computational thinking techniques were used to design the security system. Draw one line to match each computational thinking technique to its correct example. Computational thinking Example technique The system is broken down into modules for security and payments. Abstraction There is an increase in the amount of RAM in the computer running the system Decomposition The user’s identity, PIN and password are required. All other data is ignored. Algorithmic thinking The step-by-step process for users to securely pay online is designed. [3] (d) As part of the security system, the user is asked to choose a 4-digit value for their PIN. This PIN cannot be 1234 or 4321 Create an algorithm that: • takes the PIN as input as a string • checks that the PIN is 4 characters in length • checks that the PIN is not either “1234” or “4321” • outputs "VALID PIN" if the PIN meets all of the criteria • outputs "INVALID PIN" if the PIN does not meet all of the criteria. You do not need to check that the digits entered are numeric. [6] We advise you to spend approximately 40 minutes on Section B. Some questions require you to respond using either the OCR Exam Reference Language or a high-level programming language you have studied. These are clearly shown.