Designing Efficient Solutions (SQA National 5 Computing Science): Revision Note

Exam code: X816 75

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

Designing efficient solutions

How do you design an efficient solution?

  • Designing an efficient solution depends on:

    • The problem

    • Your skill level in using structure diagrams, flowcharts, and pseudocode

  • In the exam, you will be expected choose the most suitable design tool to solve the problem

Example problem

Problem

  • A parking fine is £130.

  • If this fine is paid within 14 days the fine is halved.

  • A design for a program to calculate the fine depending on when it is paid is shown below.

    1. Set fine to 130

    2. Get number of days since fine was issued

    3. Calculate and store fine

  • Using a design technique of your choice, refine step 3 of the design.

[3]

Choosing the design tool

  • The first step is to decide whether to use a structure diagram, flowchart or pseudocode

  • An efficient solution should be designed in pseudocode, because:

    • No input or output is required here because the question only asks you to refine step 3 (Calculate and store fine)

    • The focus is on using correct selection, calculation, and assignment

Example efficient solution

IF days <= 14 THEN
    SET fine TO fine / 2
END IF

Marking point

Evidence in pseudocode

Award

IF with condition: days <= 14

IF days <= 14 THEN

[1 mark]

Calculation: fine / 2

Expression fine / 2 used in assignment

[1 mark]

Assign calculated value to variable

SET fine TO fine / 2

[1 mark]

Examiner Tips and Tricks

Should I use pseudocode, a flowchart, or a structure diagram?

In most National 5 exam questions, pseudocode is the best choice

Here’s why:

  • It’s what examiners use
    Most questions that say “Using a design technique of your choice” are marked using pseudocode examples

  • It’s quick and clear
    You can show your logic using simple words like IF, THEN, and SET, without drawing boxes or arrows

  • It focuses on the logic
    You get marks for the thinking, things like decisions, loops, and calculations, not for how neat your diagram looks

Even if your pseudocode isn’t perfect, as long as it’s clear and makes sense, you’ll still get the marks

When to use other design tools

Tool

When to use it

Why

Pseudocode

Most design questions

It’s quick, clear, and matches how examiners think

Flowchart

When the question specifically asks for one or the logic is very visual

Helps show loops and decisions clearly

Structure diagram

When breaking a big program into smaller parts

Useful for showing how different sub-programs link together

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Robert Hampton

Author: Robert Hampton

Expertise: Computer Science Content Creator

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.

James Woodhouse

Reviewer: James Woodhouse

Expertise: Computer Science & English Subject Lead

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.