Revision Notes
OxfordAQA A-Level Computer Science (9645): Structured approach to programming – Revision Notes
Recall notes for OxfordAQA 9645 sub-topic 3.3.1: modularisation, parameters and return values, local variables, advantages, hierarchy and structure charts.
- Subject
- Computer Science
- Level
- AS LEVEL
- Topic
- Topic 3 – Program design
- Author
- Marlbridge Academic Team
- Updated
- Reviewed by
- Harris Khan (what this means)
Aligned to OxfordAQA A Level Computer Science (9645), 2024-onwards. Official specification .
Syllabus page (what it covers and how it is assessed): OxfordAQA A Level Computer Science.
Syllabus points this page covers
9645 (AS Level)
- 3.3.1 Structured approach to programming
This page covers 1 of the 4 subtopics in topic 3, Program design.
Found an error? Report a correction.
Need help with this topic? Request a free trial class for A Level Computer Science (9645).
These notes condense sub-topic 3.3.1 Structured approach to programming of OxfordAQA International AS and A-level Computer Science (9645), Version 1.1 (AS content in topic 3.3 Program design). For worked code and chart examples, see the structured approach study guide; then practise with the structured approach practice questions.
What the specification requires
- Understand the structured approach to program design and construction.
- Describe it, including modularised programming, parameters and return values and local (or block scope) variables.
- Explain the advantages of the structured approach.
- Construct and use hierarchy charts and structure charts when designing programs.
Key terms
| Term | Meaning |
|---|---|
| Structured approach | Designing a program as modules that have clear interfaces and keep their own data |
| Module | A self-contained subroutine that does one identifiable task |
| Parameter | A variable named in a subroutine definition that receives data |
| Argument | The value supplied for a parameter when the subroutine is called |
| Return value | The result passed back to the calling code |
| Local variable | A variable that exists only while its subroutine runs and is usable only inside it |
| Block scope | A variable that exists only inside the block (loop or selection) where it is declared (C# and VB.Net) |
| Global variable | A variable accessible throughout the program |
| Hierarchy chart | A diagram of modules and which calls which |
| Structure chart | A hierarchy chart with the data passed down and returned up labelled |
The three parts of the approach
- Modularise. Split the problem into subroutines, each with one clear job.
- Pass data through parameters and return values. Do not rely on global variables.
- Keep variables local (or block scoped) so one module cannot change another’s data.
A module should be describable as: “takes these inputs, returns that output”.
Advantages (with reasons)
| Advantage | Reason to give |
|---|---|
| Easier to read | Short, named modules; the main program reads like an outline |
| Easier to test | Each module can be tested alone with chosen inputs |
| Easier to debug | A fault is traced to one module |
| Reuse | Written once, called from many places |
| Teamwork | Modules can be written in parallel |
| Easier to maintain | A change is made in one place; local variables prevent side effects |
Charts compared
| Hierarchy chart | Structure chart | |
|---|---|---|
| Shows modules | Yes | Yes |
| Shows which calls which | Yes | Yes |
| Shows data passed | No | Yes |
| Labels | Module names | Module names, parameters, return values |
| Main use | Overall structure of the design | The interface of each module |
Worked reminder
The marks program has main calling total_of, mean_of and highest; mean_of also calls total_of. Recomputed for marks 62, 48, 75, 91, 55: total 331, mean 66.2, highest 91.
| Link | Down (parameter) | Up (return) |
|---|---|---|
main to total_of |
marks |
total |
main to mean_of |
marks |
mean |
main to highest |
marks |
best |
mean_of to total_of |
values |
result |
A structure chart label such as values (list) down and result (integer) up tells you the subroutine header: total_of(values) returns an integer.
Parameter, argument, return: a quick check
def price_with_vat(price): # price is the parameter
return round(price * 1.2, 2) # the value returned
cost = price_with_vat(19.99) # 19.99 is the argument; cost becomes 23.99
Building a structured solution: checklist
- List the tasks the program must carry out, each as a short verb phrase.
- Make each task a module with a clear name.
- Decide what each module needs as parameters and what it returns.
- Keep every other variable local to its module.
- Draw the hierarchy chart, then label the data on a structure chart.
- Write a short main program that only calls the modules in order.
- Test each module alone with chosen values, then test them together.
Example interface table for the marks program (recomputed from the earlier example).
| Module | Parameters | Returns | Result for 62, 48, 75, 91, 55 |
|---|---|---|---|
total_of |
values |
integer | 331 |
mean_of |
values |
float | 66.2 |
highest |
values |
integer | 91 |
Exam traps
- Hierarchy charts do not show data flow. Only a structure chart does.
- Parameter versus argument. The parameter is in the definition; the argument is in the call.
- Global variables make a module depend on hidden state, which breaks the structured idea.
- One job per module. If you need “and” to describe it, split it.
- Advantages need reasons. “Easier to test because each module can be run on its own” earns more than “easier to test”.
- Use the exact names on the chart in your answers.
Quick self-test
- Name the three features of the structured approach listed in the specification.
- What is a module?
- State the difference between a parameter and an argument.
- Why is passing data by parameter better than using a global variable?
- What does a local variable’s scope mean?
- State one difference between a hierarchy chart and a structure chart.
- Give two advantages of a structured program.
- In the marks program, what does
mean_ofcall? - A module takes
priceand returnsgross. Write its header in Python. - Why is
price_with_vat(50)equal to 60.0? - Can C# block scope variables be used outside their block?
- What would you do if a module needs “and” to describe what it does?
Answers
- Modularised programming; parameters and return values; local (or block scope) variables.
- A self-contained subroutine that carries out one identifiable task.
- A parameter is the variable named in the definition; an argument is the value supplied in the call.
- The module behaves the same wherever it is called and can be tested alone; a global could be changed by other code.
- The variable exists only while the subroutine runs and is accessible only inside it.
- A structure chart also labels the data passed down and returned up; a hierarchy chart does not.
- Any two, each with a reason, such as easier testing and reuse.
total_of.def price_with_vat(price):(returning the gross value).- 50 × 1.2 = 60.0 after rounding to 2 decimal places.
- No. They exist only inside the block where they are declared.
- Split it into two modules.
- Structured approach study guide
- Structured approach practice questions
- Program design revision notes
Official syllabus
OxfordAQA International AS and A-level Computer Science (9645) specification, Version 1.1, for International AS exams May/June 2025 onwards and International A-level exams May/June 2026 onwards: sub-topic 3.3.1 Structured approach to programming.
Related resources
-
Study guides
OxfordAQA A-Level Computer Science (9645): Abstraction and decomposition
OxfordAQA 9645 sub-topic 3.3.2 in depth: abstraction, decomposition, worked examples of each and how subroutines put decomposition into practice.
Computer Science · OxfordAQA · AS Level
Read guide -
Practice questions
OxfordAQA A-Level Computer Science (9645): Abstraction and decomposition – Practice Questions
Ten original OxfordAQA 9645 questions on sub-topic 3.3.2: abstraction, decomposition, choosing details to keep and splitting problems into subroutines.
Computer Science · OxfordAQA · AS Level
Try questions -
Revision notes
OxfordAQA A-Level Computer Science (9645): Abstraction and decomposition – Revision Notes
Recall notes for OxfordAQA 9645 sub-topic 3.3.2: definitions of abstraction and decomposition, examples, benefits, exam traps and a self-test.
Computer Science · OxfordAQA · AS Level
Revise topic
Get free revision emails (optional)
Occasional emails with practice questions, worked explanations and links to free resources for the qualification and subjects you choose. No spam, and you can unsubscribe from any email. The free tools on this site never need an email.