Cambridge A2 Level Computer Science 9618 · 20.2 File Processing and Exception Handling

Q24 · 9618/32/M/J/22 Q9

Worked solution from the Further Programming Paper 3 Advanced Theory booklet, Part 2 of 2.

Q249618/32/M/J/22original Q9Structured · 4 marks
Question 9 from 9618/32/M/J/22

Worked solution

Say what exception handling does, then give an example:

Write: It traps (some) runtime errors [1]

Write: It prevents the program halting (crashing) unexpectedly [1]

Write: It lets the program give a meaningful error message about the error [1]

Write an example exception: divide by zero (or end of file, or file not found) [1]

KEY IDEAException handling catches runtime errors so the program carries on and tells the user what went wrong.
TOTAL 4 marks

Official mark scheme

Mark scheme for 9618/32/M/J/22 question 9
VIDEO
▶ Whole paper

Video solution of the whole paper · by qiphyedu. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.