AQA A-Level Computer Science AS Paper 1, June 2025: Question 8

3 marks ยท Medium difficulty ยท Short Answer

Identify a subroutine in the Skeleton Program using exception handling and explain why exception handling is used within it.

Practise this question

Question

Question 08 consists of two parts. Part 08.1 asks to state the identifier of a subroutine in the Skeleton Program that uses exception handling, worth 1 mark. Part 08.2 asks to explain why exception handling is used in this subroutine, worth 2 marks.
Question text

08.1 State the identifier of a subroutine in the Skeleton Program that uses

exception handling.

[1 mark]

08.2 Explain why exception handling is used in this subroutine.

[2 marks]

Mark scheme

Show the mark scheme Mark scheme for question 08. Part 08.1 awards 1 mark for AO2: CheckDistance; with guidance to reject if any additional code or spelt incorrectly, and ignore case and spacing. Part 08.2 awards 2 marks for AO2: The string/character supplied may not be (convertible to) an integer; Without exception handling the program would crash.

08 1 Mark is for AO2 (analyse) 1

CheckDistance;

R. if any additional code

R. if spelt incorrectly

I. case and spacing

08 2 2 marks for AO2 (analyse) 2

The string/character supplied may not be (convertible to) an integer;

Without exception handling the program would crash;

How to answer it

Exception Handling in the Skeleton Program

๐Ÿ“Œ What this question tests

This question evaluates your ability to navigate, inspect, and analyse the Skeleton Program (Assessment Objective AO2). Specifically, it assesses:

  • Identifying programming constructs such as structured exception handling (e.g. try...except / try...catch blocks).
  • Understanding the operational purpose of defensive programming: preventing runtime crashes during data type conversion (casting) of user inputs.

Question 08.1

1 Mark • AO2 (Analyse)

Identify the subroutine using exception handling

โœ… Correct Answer

CheckDistance

Case and spacing are ignored by examiners, but exact spelling is strictly required.

๐Ÿง  Exam Technique

  • Use Ctrl+F: Quickly search the Skeleton Program file for language-specific keywords:
    โ€ข Python: try or except
    โ€ข C# / Java: try or catch
    โ€ข VB.NET: Try or Catch
  • Give only the identifier name. Do not include parentheses or parameters unless explicitly asked.

โŒ Common Errors & Mark Scheme Guidance

  • Reject (R): Providing extra code alongside the subroutine identifier (e.g. writing Function CheckDistance() or CheckDistance = True ).
  • Reject (R): Misspelling the name (e.g. CheckDistances or ChekDistance ).
  • Ignore (I): Differences in case or surrounding whitespace (e.g. checkdistance is fully credited).
Mark Scheme Breakdown: 1 mark for precisely stating CheckDistance .

Question 08.2

2 Marks • AO2 (Analyse)

Explain the purpose of exception handling in CheckDistance

โœ… Model Answer (Full 2 Marks)

To secure both marks, your response must cover the cause of the potential error and the consequence avoided:

  1. Mark 1 (Input/Type issue): The string or character entered by the user may not be valid or convertible to an integer.
  2. Mark 2 (System outcome): Without exception handling, this conversion would produce a runtime error and cause the program to crash / terminate unexpectedly.

๐Ÿ’ก Key Knowledge: Why Catch Errors?

In user-facing programs, input always enters as a string/text format:

  • Converting "15" → integer 15 succeeds.
  • Converting "fifteen" or "" → throws an exception (e.g. ValueError or FormatException ).
  • Graceful Recovery: Exception handling intercepts this runtime error, allowing the program to display an error prompt and ask again rather than halting execution.

๐Ÿง  Exam Technique: "Explain Why" Pattern

For a 2-mark explanation question on error handling, always follow the two-part structure:

[Specific Trigger] What user action creates the fault? (e.g. "entering non-numeric data that cannot cast to an int")
+
[Program Consequence] What bad outcome does the handler avoid? (e.g. "prevents an unhandled exception causing a program crash").

โŒ Common Misconceptions & Lost Marks

  • Vague answers: Simply writing "to stop errors" or "to validate data" scores 0 marks without explaining which error or how it crashes.
  • Missing the conversion aspect: Forgetting to mention the data type mismatch (string cannot be converted to integer).
  • Confusing validation with exception handling: Saying "it checks if the distance is between 1 and 10" misses the point. Exception handling specifically traps runtime conversion failures, not range boundaries.
Mark Scheme Breakdown:
โ€ข 1 Mark: The string/character supplied may not be (convertible to) an integer.
โ€ข 1 Mark: Without exception handling the program would crash / halt execution.

Topics

4.1 Fundamentals of programming ยท 4.1.1 Programming

Question and mark scheme from the AQA A-Level Computer Science examination, AS Paper 1, June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.