Once the problem and functional requirements are understood, the next step is to design the solution.
Why is Design Important?
Without a clear plan, coding a program is like building a house without blueprints—things will break, and fixing errors later will be a nightmare.
A good software design helps:
✔ Plan ahead before coding.
✔ Catch mistakes early.
✔ Make the program efficient and easy to understand.
Before writing code, we need to decide how to store and organize data.
💡 Choosing the right data type makes a program more efficient and prevents errors.
To plan the logic of a program, we can use three common design methods:
Structure diagrams break a problem into smaller, manageable steps.
Think of them as a family tree, showing how tasks connect.
Structure diagrams graphically show the steps needed to solve a problem.
Structure diagrams must be read from the top down from left to right
Structure Diagram Symbols:
Process - Used to show that a process is needed.
Loop - Used to show that repetition / iteration is taking place.
Selection - Used to show that there are different outcomes through conditional statements.
Pre-defined function - Used to make use of a pre-defined function (Round, Len, Random)
Example: This diagram represents a program that:
inputs 10 numbers
validates each number (0 to 100)
keeps a running total of the numbers
outputs the final total
Pseudocode is structured plain English that describes what a program will do.
The SQA have their own Reference Language which follows these rules:
Example: Finding the Largest of Two Numbers
✔ Readable for both programmers and non-programmers.
✔ Easier to convert into actual code later.
Example
BEGIN
// Receive two numbers from the user
SEND "Enter first number: " TO DISPLAY
RECEIVE num1 FROM INTEGER
SEND "Enter second number: " TO DISPLAY
RECEIVE num2 FROM INTEGER
// Compare numbers and determine the largest
IF num1 > num2 THEN
SEND "The largest number is " & num1 TO DISPLAY
ELSE
SEND "The largest number is " & num2 TO DISPLAY
END IF
END
Flowcharts show the flow of decisions using symbols.
Flow Line - Shows the direction of flow within your program
Terminal - Shows the start and end of a problem
Initialisation - Declares variables and arrays or assigns a value
Input / Output - Show data input or data output
Decision - Shows that a decision is to be made, with branches for different outcomes. Used in loops or IF statements.
Process - Used to show that a process is needed.
Pre-defined function - Used to make use of a pre-defined function (Round, Len, Random)
On-page Connector - Used if the flowchart has reached the bottom of a page. The connector lets the chart continue from another point.
Example
The program adds up three numbers entered by the user, and stores the answer in the variable total.
A program’s user interface (UI) is how users interact with it.
A wireframe is a simple sketch showing:
✔ Where buttons and text fields go.
✔ How information is displayed.
✔ What inputs are required.
Example
Use a wireframe to design the user-interface of a program which:
asks the user to enter three numbers
adds the numbers together
displays the total of the three number
A fully designed program should have:
✅ Well-chosen data types (efficient storage).
✅ A clear structure using diagrams, flowcharts, or pseudocode.
✅ A well-thought-out user interface (wireframes).
Design first, code later. This makes development faster, smoother, and less error-prone.