Bad IB questions 2

Here’s another one.

Question:
Outline how a run-time error could occur in a computer program (2 marks)

Mark Scheme Answer:
Attempt to divide by zero (1 mark); error occurs because this is an illegal operation for the compiler (1 mark)

Truth:
Firstly, divide by zero is one of hundreds of possible run-time errors. Other examples are null pointer exceptions, array out of bounds, type mismatch, overflow, out of memory, etc. Secondly, by its very definition a run-time error has nothing to do with the compiler. The compiler has long since left the equation. The compiler can only generate compile-time errors, which are often syntax errors, like “else with if” or “expected ;”, or can be structural or semantic problems like “method not found”, “cannot return a value from method of type void”, or “not a statement”.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s