Skip to content

2.1.4 Thinking Logically Exam Questions

Paper 2 · Algorithms & Programming · 1 past paper question · 7 practice questions · 25 marks

Exam questions for 2.1.4 Thinking logically

1 OCR past paper question and 7 practice questions (25 marks) with mark schemes

Answer each question, reveal the mark scheme, then award yourself marks. Scores and answers are saved in this browser so you can see which topics need more work.

Download Questions & Mark Scheme (PDF)

Past paper questions

  1. Question 1H446/024 marks

    Logical conditions are checked once a player has rolled the dice. Describe two different logical conditions and how the result will affect the outcome of the game.

    Show mark scheme
    Condition: Check if the square has an instruction → Outcome: move the player the number of places specified. Condition: Check if they have landed on square 100 → Outcome: Announce the player as the winner. Condition: Check if the timer is 0 → Outcome: Announce the game as a draw. (4 marks - 1 for condition, 1 for outcome each)
    Mark yourself: how many marks did you get?
    / 4
  2. Question 2Practice question · H446/02 style3 marks

    A program asks for a user's age and then decides which menu to show: a children's menu for anyone under 13, a standard menu for ages 13 to 64, and a senior menu for anyone aged 65 or over. Identify the decision points in this program and state the condition tested at each one.

    Show mark scheme
    • First decision: is age < 13? If so, show the children's menu • Second decision: is age <= 64 (or age < 65)? If so, show the standard menu • Otherwise (age >= 65) show the senior menu Accept an equivalent if / elseif / else structure with correct conditions. (3 marks – 1 per decision with its condition)
    Mark yourself: how many marks did you get?
    / 3
  3. Question 3Practice question · H446/02 style4 marks

    The following pseudocode controls a vending machine. 01 credit = 0 02 while credit < price 03 coin = input("Insert coin") 04 credit = credit + coin 05 endwhile 06 if credit > price then 07 print("Change: " + str(credit - price)) 08 endif 09 print("Dispense item") Describe how the decision on line 06 affects the flow of the program, and explain what is output when price is 80 and the coins inserted are 50 and then 50.

    Show mark scheme
    • Line 06 compares credit with price • If credit is greater than price, line 07 runs and the change message is printed; otherwise line 07 is skipped and the program continues at line 09 • With coins of 50 then 50, the loop ends when credit reaches 100 (100 is not less than 80) • 100 > 80, so "Change: 20" is printed, followed by "Dispense item" (4 marks – 1 per point)
    Mark yourself: how many marks did you get?
    / 4
  4. Question 4Practice question · H446/02 style3 marks

    State the output of the following pseudocode and explain why the other branches do not run. 01 x = 12 02 if x MOD 2 == 0 AND x > 10 then 03 print("A") 04 elseif x > 10 then 05 print("B") 06 else 07 print("C") 08 endif

    Show mark scheme
    • Output: A • 12 MOD 2 is 0 and 12 > 10, so the condition on line 02 is true • Once one branch of an if / elseif / else has been taken, the remaining branches are skipped, so "B" and "C" are never printed (3 marks – 1 per point)
    Mark yourself: how many marks did you get?
    / 3
  5. Question 5Practice question · H446/02 style2 marks

    Explain the difference between the conditions x > 5 OR y > 5 and x > 5 AND y > 5. Give values of x and y for which the two conditions give different results.

    Show mark scheme
    • OR is true when at least one of the conditions is true; AND is only true when both are true • e.g. x = 6 and y = 2: the OR condition is true but the AND condition is false (2 marks – 1 per point)
    Mark yourself: how many marks did you get?
    / 2
  6. Question 6Practice question · H446/02 style4 marks

    A login procedure must lock the account after three incorrect passwords. Write pseudocode for the decisions needed, using a loop and a counter.

    Show mark scheme
    • A counter (e.g. attempts) is initialised to 0 before the loop • A loop repeats while the password is incorrect AND attempts < 3 • attempts is increased by 1 each time an incorrect password is entered • After the loop: if attempts == 3 then lock the account, else grant access Example: attempts = 0 password = input("Password") while password != correct AND attempts < 3 attempts = attempts + 1 password = input("Password") endwhile if attempts == 3 then lockAccount() else grantAccess() endif (4 marks – 1 per point)
    Mark yourself: how many marks did you get?
    / 4
  7. Question 7Practice question · H446/02 style3 marks

    A thermostat program turns the heating on when the temperature is below 18 degrees and off when it is above 21 degrees. Between those values it leaves the heating as it is. Write pseudocode for this decision using if / elseif / else.

    Show mark scheme
    • if temperature < 18 then heating = on • elseif temperature > 21 then heating = off • else the heating is left unchanged (no action) (3 marks – 1 per point)
    Mark yourself: how many marks did you get?
    / 3
  8. Question 8Practice question · H446/02 style2 marks

    Explain why a program that validates a date must make its decision about the month before it checks the day.

    Show mark scheme
    • The number of valid days depends on the month (30 or 31, and 28 or 29 in February) • So the outcome of the month decision determines which condition is applied to the day; the order of the decisions changes the result (2 marks – 1 per point)
    Mark yourself: how many marks did you get?
    / 2
Key Exam Tips for 2.1.4
  • 1Decision points: Paradigm, language, hardware choice
  • 2Evaluation criteria: Effectiveness, convenience, feasibility
  • 3Program flow: Plan for ALL valid user choices including errors
General Exam Advice
  • •Practice answering questions under timed conditions
  • •Check your answers against the mark scheme carefully
  • •Focus on understanding the marking points, not just memorising answers
  • •Review past paper questions from multiple years to spot patterns