Free revision guides

Evaluating a program: answers that gain the mark

National 5 Computing Science: Software design and development

Evaluation questions ask whether a program is fit for purpose, efficient, robust and readable. The examiners' reports for 2023, 2024 and 2025 all make the same point: general answers learned by heart do not gain marks. Your answer has to be about the code in front of you.

Efficient use of coding constructs

Here are two ways to give a medal from a score:

Version A
IF points >= 90 THEN
   SET medal TO "Gold"
END IF
IF points >= 75 AND points < 90 THEN
   SET medal TO "Silver"
END IF
IF points >= 60 AND points < 75 THEN
   SET medal TO "Bronze"
END IF

Version B
IF points >= 90 THEN
   SET medal TO "Gold"
ELSE IF points >= 75 THEN
   SET medal TO "Silver"
ELSE IF points >= 60 THEN
   SET medal TO "Bronze"
END IF

Both give the same medal. Version B is more efficient: once one condition is true, the rest are not checked. Version A checks all three conditions every time. Few candidates spot this, the reports say.

Which answer gains the mark?
  • "Version B is more efficient." (It says which, but not why.)
  • "Version B is shorter." (Shorter is not the point.)
  • "In Version B, once a condition is true the other conditions are not checked. Version A always checks all three IF statements."

The other common efficiency answer: if the same lines are copied out several times, a loop (and an array for the values) would be more efficient.

Readability

Learn the four features by name: meaningful identifiers, internal commentary, indentation and white space. If the question points at certain lines, your example must be something you can actually see in those lines: "the variable ticketCost is a meaningful identifier", not just "it uses meaningful identifiers".

Robustness

A robust program copes with unexpected input without crashing. A good answer names what would go wrong in this program: "if the user enters a negative distance, the program displays a negative journey time", rather than "it doesn't validate the input".

Try two exam-style questions

Choose an answer, say how sure you are, then press Check. Every wrong answer tells you why it is wrong.

The Evaluating a program simulation
In the course: Evaluating a program. Judge real programs for fitness for purpose, efficiency, robustness and readability, and see which answers gain the mark.

The full course covers every topic like this. Every topic in National 5 Computing Science has a short note, a simulation to try and a practice quiz with feedback on every answer, plus coding lessons, a full mock exam and a progress report for parents.

Create an accountTry more for freeAbout the course

More guides

This site is independent: it is not connected to the SQA or Qualifications Scotland. Points from the examiners' course reports are given in our own words.