Structured Programming (AQA GCSE Computer Science): Revision Note

Exam code: 8525

James Woodhouse

Written by: James Woodhouse

Reviewed by: Lucy Kirkham

Updated on

Structured Programming

What is structured programming?

  • Structured programming is the process of breaking down a large problem into a set of smaller problems

  • The smaller sub-problems are then used to:-

    • Work out the parameters needed

    • Decide which data type would be the most appropriate

    • Work if out if a value is needed to be returned

  • An examples of this process in computing is:

Computer games

  • Modern computer games are decomposed to break down the complexity of the problem into more manageable 'chunks'

  • Creating an entire game at once would be challenging and inefficient, so it could be decomposed into:

    • Levels - Levels can be designed/created/tested/ independently of other levels

    • Characters - The mechanics of characters in the game can be designed and created by a separate team

    • Landscape - The art team can work on the visual aspects of the game without needing to understand how the game is programmed

  • Once all of the smaller problems are completed, joined together a complex game has been created

Advantages of structured programming

Advantage

Explanation

Easier to read and understand

Code is organised into small, manageable modules or functions, improving clarity

Easier to test and debug

Each module can be tested independently, making it simpler to find and fix errors

Promotes code reuse

Functions or procedures can be reused in different parts of the program or in other programs

Improves collaboration

Multiple programmers can work on different modules simultaneously without conflicts

Easier to maintain and update

Changes can be made to individual modules without affecting the whole program

Reduces complexity

Breaking down large problems into smaller subproblems makes them easier to solve

Encourages good programming habits

Reinforces the use of clear structures like sequence, selection, and iteration, which are core programming constructs in the AQA spec

Using a Hierarchy Chart

  • Problems can be decomposed using tables and lists, however larger problems can quickly become cumbersome using this approach so diagrams are preferred

What is a Hierarchy chart?

  • A hierarchy chart is an example of a diagram used to show problem decomposition in structured programming

  • Each problem is divided into multiple subproblems, which is turn are divided into further subproblems until they cannot be divided any further

  • Hierarchy charts show how module and subroutines relate to each other and is depicted as a tree structure

  • Hierarchy charts can be created on paper or digitally and can also be created programmatically by software

  • An example of a hierarchy chart is shown below for a sending messages and calls on a mobile phone. Each sub-problem is broken down into smaller sub-problems:

figure-x--a-hierarchy-chart-of-a-mobile-phone

Worked Example

Mabel is a software engineer. She is writing a computer game for a client. In the game the main character has to avoid their enemies. This becomes more difficult as the levels of the game increase.

The computer game allows a user to select a character (e.g. name, gender). They can then choose a level for the game (easy, normal, challenging). The user controls their character by moving it left or right. The character can jump using space bar as an input. If the character touches one of the enemies then it loses a life. The character has to make it to the end of the level without losing all their lives.

  • The game is designed in a modular way.

  • One sub-procedure will handle the user input.

Describe three other sub-procedures Mabel could create for the given game description. [6]

ANSWER

Mabel could create a sub-procedure to select a character, including name and gender, etc [1], which gives the user options when choosing a character [1]

Mabel could create a sub-procedure to choose a level [1] which gives the user a choice of difficulty (easy, medium, challenging) by taking the user input [1]

Mabel could create a sub-procedure to allow the character to lose lives [1]. If the character has less than 0 lives left then the game ends [1]

Examiner Tips and Tricks

Basic input procedures such as moving left and right are not credit worthy but showing the output of a left/right move would be

You've read 0 of your 5 free revision notes this week

Unlock more, it's free!

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

the (exam) results speak for themselves:

Did this page help you?

James Woodhouse

Author: 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.

Lucy Kirkham

Reviewer: Lucy Kirkham

Expertise: Head of STEM

Lucy has been a passionate Maths teacher for over 12 years, teaching maths across the UK and abroad helping to engage, interest and develop confidence in the subject at all levels.Working as a Head of Department and then Director of Maths, Lucy has advised schools and academy trusts in both Scotland and the East Midlands, where her role was to support and coach teachers to improve Maths teaching for all.