Skip to content
IGCSE·Tuition

Computer Science · Topics

Problem-solving explanations

You can often fix the code in your head and still lose the marks because the explanation on paper is thin.

On this page
  1. What should you already know?
  2. An orienting example
  3. In what order should you study the lessons?
  4. What traps catch students in this topic?
  5. How should you use the practice set?

This module is about the written side of problem solving. Exam questions often ask you to explain what a variable is for, justify a test, describe how to correct an error, or say why a trace gives a certain output. Knowing the answer is only half the job; the other half is saying it so a marker can credit each point.

Check the current Cambridge Computer Science 0478 syllabus for the content points and command words in your exam year. Our Computer Science learning guide shows where this module sits among the others.

What should you already know?

You should be able to read short pseudocode with assignment, IF, FOR and WHILE, and to follow it with a trace table. If that is shaky, start with pseudocode for the applicable syllabus and algorithm design. Testing ideas are covered in validation, verification and testing.

An orienting example

Here is a short algorithm and four explanations a question might ask for.

Total ← 0
FOR Index ← 1 TO 3
   INPUT Number
   Total ← Total + Number
NEXT Index
Average ← Total / 2
OUTPUT Average

Purpose of a variable. Total holds the running sum of the numbers entered so far. It starts at 0 because nothing has been added yet.

A justified test. Requirement: output the average of three numbers. Test data 4, 6, 8 is useful because the expected average, 6, is easy to work out by hand.

A described correction. Line 6 divides by 2, but three numbers were entered. Change the divisor to 3.

A trace linked to output. With 4, 6, 8, Total becomes 4, 10, 18. Then 18 / 2 = 9 is output, which does not match the expected 6. That mismatch shows the fault.

Notice that each answer names a line, a value or a requirement, not just “it is wrong”.

In what order should you study the lessons?

  1. Explain the purpose of a variable: say what a variable holds and why, not just repeat its name.
  2. Justify a test case with a requirement: tie every test value to a rule it checks.
  3. Describe a correction rather than merely show code: name the line, the fault and the change in words.
  4. Connect a trace with final output: show which row of the trace produces the answer.
  5. Prepare a minimal reproducible learning example: shrink a problem to the smallest case that still fails.

Then work through the problem-solving explanations practice set. The restricted pseudocode trace trainer and the safe Python reasoning sandbox let you check small traces, and the mistake log and retest queue helps you track repeated errors.

What traps catch students in this topic?

  • Explaining a variable by repeating its name (“Total stores the total”).
  • Writing test data without saying what each value checks.
  • Describing a fix as “make it correct” without naming the line or the change.
  • Giving the last value in a trace as the output when the output is a different variable.
  • Shrinking a failing program until the fault disappears.

How should you use the practice set?

Write your own explanation in full sentences before opening each answer. Compare it with the worked answer and mark which required point you missed: the named line, the value, the reason or the requirement. The “if you got these wrong” section points each error type to a lesson.

Students who want someone to read their written explanations can ask about our online one-to-one Computer Science tuition.

Sources

  1. Cambridge IGCSE Computer Science 0478 syllabus page

Updated:

Your next step

If you can spot an error but struggle to put the reason into clear sentences, a one-to-one teacher can read your written explanations with you and sharpen them line by line.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80. Other fees, schedules and ongoing arrangements are confirmed directly with your teacher after the trial class.

9,000+ students helped through our service