Skip to content
Android waitlistTry on iPad

Variables, constants, operators and constructs: OCR GCSE Computer Science questions

Every OCR GCSE Computer Science exam question on 2.2.1 Variables, constants, operators and constructs, 2022–2025, with its mark scheme and examiner’s report.

Paper
All papers
Exam
All years
Calculations

282 questions

  1. Q1(b)(ii)

    June 2025 · Paper 2

    The whole paper ↗
  2. Q1(b)(iii)

    June 2025 · Paper 2

    The whole paper ↗
  3. Q2(b)(i)

    June 2025 · Paper 2

    The whole paper ↗
  4. Q2(b)(ii)

    June 2025 · Paper 2

    The whole paper ↗
  5. Q6(a)(i)

    June 2025 · Paper 2

    The whole paper ↗
  6. Q6(a)(ii)

    June 2025 · Paper 2

    The whole paper ↗
  7. Q1

    June 2024 · Paper 2

    The whole paper ↗
  8. Q1(b)

    June 2023 · Paper 2

    The whole paper ↗
  9. Q1(c)(i)

    June 2023 · Paper 2

    The whole paper ↗
  10. Q1(c)(ii)

    June 2023 · Paper 2

    The whole paper ↗
  11. Q1(c)(iii)

    June 2023 · Paper 2

    The whole paper ↗
  12. Q3(b)

    June 2023 · Paper 2

    The whole paper ↗
  13. Q6(b)

    June 2023 · Paper 2

    The whole paper ↗
  14. Q6(c)(ii)

    June 2023 · Paper 2

    The whole paper ↗
  15. Q6(c)(v)

    June 2023 · Paper 2

    The whole paper ↗
  16. Q1(a)

    June 2022 · Paper 2

    The whole paper ↗
  17. Q1(b)

    June 2022 · Paper 2

    The whole paper ↗
  18. Q4(b)(i)

    June 2022 · Paper 2

    The whole paper ↗
  19. Q7(b)

    Specimen · Paper 2

    The whole paper ↗
  20. Q7(c)(i)

    Specimen · Paper 2

    The whole paper ↗
All 23 questions on Variables, constants, operators and constructs, as a list
  1. June 2025, Paper 2, Q1(b)(ii) (1 mark): Give the identifier of one variable used in the algorithm in part (b)(i). [1]
  2. June 2025, Paper 2, Q1(b)(iii) (1 mark): Give one Boolean operator used in the algorithm in part (b)(i). [1]
  3. June 2025, Paper 2, Q2(b)(i) (4 marks): Identify and describe two different examples of iteration that can be used in a high-level language. 1 2 [4]
  4. June 2025, Paper 2, Q2(b)(ii) (2 marks): Give the names of two other programming constructs that are used in a high-level language. 1 2 [2]
  5. June 2025, Paper 2, Q6(a)(i) (1 mark): Tick (✓) one box to identify the correct OCR Exam Reference Language statements for the design of this task. Tick (✓) OCR Exam Reference Language to enter two p
  6. June 2025, Paper 2, Q6(a)(ii) (3 marks): Design an algorithm that: • checks if the passwords stored in passA and passB are the same • outputs "passwords match" if they are the same • outputs "passwords
  7. June 2024, Paper 2, Q1 (3 marks): Tick (✓) one box in each row to identify the programming construct where each keyword is used. Programming construct Keyword Selection Iteration if for while [3
  8. June 2023, Paper 2, Q1(b) (1 mark): The variables num1 and num2 store integers. Write pseudocode to add the integers stored in num1 and num2. Store the result in a variable with the identifier tot
  9. June 2023, Paper 2, Q1(c)(i) (1 mark): Outputting 12 to the power of 2. print(12 ……………… 2) [1]
  10. June 2023, Paper 2, Q1(c)(ii) (1 mark): Working out if a number is odd or even. number = 53 if number ……………… 2 == 0 then print("Even number") else print("Odd number") endif [1]
  11. June 2023, Paper 2, Q1(c)(iii) (1 mark): Finding the difference between two measurements. measurement1 = 300 measurement2 = 100 difference = measurement1 ……………… measurement2 [1]
  12. June 2023, Paper 2, Q3(b) (2 marks): An insertion sort contains a nested loop; a loop within a loop. In this pseudocode algorithm the outer loop is a count-controlled loop and the inner loop is a c
  13. June 2023, Paper 2, Q6(b) (4 marks): The alarm has an algorithm that decides whether to sound the alarm by checking the data that is stored in the following three variables. • SystemArmed • DoorSen
  14. June 2023, Paper 2, Q6(c)(ii) (1 mark): Give the identifier of a variable used in the program. [1]
  15. June 2023, Paper 2, Q6(c)(v) (2 marks): Identify two programming constructs that have been used in the program. 1 2 [2]
  16. June 2022, Paper 2, Q1(a) (4 marks): Tick (3) one box in each row to identify whether the OCR Reference Language code given is an example of selection or iteration. OCR Reference Language code Sele
  17. June 2022, Paper 2, Q1(b) (1 mark): Write pseudocode to increment the value held in the variable score by one. [1]
  18. June 2022, Paper 2, Q4(b)(i) (2 marks): State the purpose of each of the arithmetic operators in the table. Arithmetic operator Purpose * / [2]
  19. Specimen, Paper 2, Q7(b) (2 marks): Identify two variables used in the program. 1 ……………………………………………………………………………………………………………… 2 …………………………………………………………………………………………………………..….. [2]
  20. Specimen, Paper 2, Q7(c)(i) (1 mark): Identify one item in the program that could have been written as a constant. ………………………………………………………………………………………………………. [1]
  21. Specimen, Paper 2, Q7(c)(ii) (1 mark): Give one reason why you have identified this item as a constant. ……………………………………………………………………………………………………… [1]
  22. Specimen, Paper 2, Q7(d) (3 marks): Tick (✓) one box in each row to identify whether each programming construct has or has not been used in the program. Has been used Has not been used Sequence Se
  23. Specimen, Paper 2, Q8(d) (4 marks): The teacher writes a program to add up and print out the total number of minutes student 2 played computer games over 5 days (Monday to Friday). total = 0 total

Questions, mark schemes and examiner’s reports are © OCR, from their published past papers. Plumi isn’t affiliated with any exam board. Want whole papers? Full past papers.

Rather write your answers by hand on iPad? Plumi marks them against the same mark schemes.