Skip to topic
    ← Back to course topics

    Topic 6: Problem solving with programming — Edexcel GCSE Computer Science

    Test yourself on Topic 6: Problem solving with programming with PEARSON EDEXCEL GCSE practice questions.

    Start free

    7 days Premium · Then free forever · No card, no charge

    Topic 6: Problem solving with programming explained

    Topic 6 focuses on the practical application of computational thinking through programming in Python 3.

    Read the full explanation

    Students are required to design, write, test, and refine programs to solve problems, utilizing the Programming Language Subset (PLS) to demonstrate proficiency in coding constructs, data structures, and subprograms.

    Read the Topic 6: Problem solving with programming study guideFull revision notes for Edexcel GCSE Computer Science

    What to demonstrate

    1. Correct use of decomposition and abstraction to analyze and solve problems
    2. Ability to read, write, analyze, and refine high-level programming code
    3. Successful conversion of algorithms (flowcharts, pseudocode) into functional programs
    Show all 9 objectives
    1. Implementation of good programming practices including indentation, comments, and meaningful identifiers
    2. Identification and correction of syntax, logic, and runtime errors
    3. Use of logical reasoning and test data to evaluate fitness for purpose and efficiency
    4. Appropriate use of programming constructs: sequence, selection, iteration, and subprograms
    5. Correct manipulation of data types and structures (strings, arrays, records)
    6. Implementation of input/output, file handling (CSV), validation, and authentication

    Topic 6: Problem solving with programming exam tips

    Topic Overview

    Topic 6: Problem solving with programming is the heart of GCSE Computer Science, where you learn to break down complex problems into manageable steps and implement solutions using a high-level language like Python. This topic covers computational thinking, algorithms, and programming constructs—sequence, selection, and iteration—as well as data structures such as arrays (lists) and records. You'll also explore subprograms (functions and procedures), file handling, and basic error handling. Mastering this topic is essential because it develops logical reasoning and systematic problem-solving skills that are valuable in any career, not just computing.

    In the Edexcel GCSE, this topic is assessed in both Paper 1 (principles of computer science) and Paper 2 (application of computational thinking). You'll be expected to write, interpret, and debug code, as well as design algorithms using flowcharts or pseudocode. The skills you build here—decomposition, pattern recognition, abstraction, and algorithm design—are the foundation of all programming. By the end, you should be able to take a real-world problem, design a solution, and code it effectively.

    This topic connects directly to other areas of the specification, such as data representation (Topic 3) and networks (Topic 4), but it's the practical application that brings everything together. Whether you're automating a task, analysing data, or creating a game, programming is the tool that turns ideas into reality. In the exam, you'll need to show both your understanding of theory and your ability to apply it—so practice writing code by hand and on a computer.

    Key Concepts
    • →Computational thinking: decomposition (breaking a problem down), pattern recognition (spotting similarities), abstraction (focusing on important details), and algorithm design (step-by-step solutions).
    • →Programming constructs: sequence (code runs line by line), selection (if/else statements), and iteration (for and while loops). Understand how to use these to control program flow.
    • →Data structures: arrays/lists (one-dimensional and two-dimensional) to store multiple items, and records (using dictionaries or classes) to group related data. Know how to access, update, and traverse them.
    • →Subprograms: functions and procedures to break code into reusable blocks. Understand parameters, return values, and local vs global variables.
    • →File handling: reading from and writing to text files (open, read, write, close). Be able to handle file-not-found errors and use 'with' statements for safe file access.
    Marking Points
    • Correct use of decomposition and abstraction to analyze and solve problems
    • Ability to read, write, analyze, and refine high-level programming code
    • Successful conversion of algorithms (flowcharts, pseudocode) into functional programs
    • Implementation of good programming practices including indentation, comments, and meaningful identifiers
    • Identification and correction of syntax, logic, and runtime errors
    • Use of logical reasoning and test data to evaluate fitness for purpose and efficiency
    • Appropriate use of programming constructs: sequence, selection, iteration, and subprograms
    • Correct manipulation of data types and structures (strings, arrays, records)
    • Implementation of input/output, file handling (CSV), validation, and authentication
    Examiner Tips
    • 💡Ensure familiarity with the Programming Language Subset (PLS) as it contains the essential constructs for all exam questions
    • 💡Practice using an IDE with features like breakpoints, stepping, and variable inspection to improve debugging skills
    • 💡Use 'unplugged' activities to trace and read code on paper before writing it
    • 💡Focus on the PRIMM approach (predict, run, investigate, modify, make) to build programming confidence
    • 💡Ensure all programs are robust by implementing necessary validation and authentication checks
    • 💡Always plan your algorithm using pseudocode or a flowchart before writing code. In the exam, even if your code has syntax errors, a clear algorithm can earn you marks for logic. Show your working—examiners love trace tables.
    • 💡Use meaningful variable names (e.g., 'totalScore' not 'x'). This makes your code readable and shows the examiner you understand good practice. Also, comment your code briefly to explain complex sections.
    • 💡When answering 6-mark 'write a program' questions, structure your answer: start with inputs, then processing (using loops/selection), then output. Check edge cases (e.g., empty list, negative numbers) and mention validation. Even if you can't complete the code, partial marks are awarded for correct constructs.
    Common Mistakes
    • Failure to use meaningful variable names leading to unreadable code
    • Inadequate testing of programs with edge cases or invalid data
    • Confusing local and global variable scope
    • Incorrect implementation of file handling or data validation routines
    • Poor use of comments and indentation making code difficult to maintain
    • Misconception: 'If I write the code correctly, it will always work first time.' Correction: Even experienced programmers debug constantly. Use trace tables and print statements to check your logic step by step. The exam expects you to identify and fix errors.
    • Misconception: 'A while loop and a for loop are interchangeable in all situations.' Correction: For loops are best when you know the number of iterations (e.g., iterating through a list). While loops are for when you don't know the exact count (e.g., until a condition is met). Using the wrong one can lead to infinite loops or inefficient code.
    • Misconception: 'Variables declared inside a function are accessible everywhere.' Correction: Variables inside a function are local—they only exist within that function. To use a value outside, you must return it. Global variables are accessible everywhere but should be used sparingly.
    Frequently Asked Questions
    What is the difference between a function and a procedure in GCSE Computer Science?
    A function returns a value to the calling code, while a procedure does not. For example, a function called 'calculateArea' might return the area as a number, whereas a procedure called 'displayMenu' just prints text. In Python, both are defined using 'def', but a function uses 'return' to send back a result. You need to know this for the exam because questions often ask you to identify or write subprograms.
    How do I choose between a for loop and a while loop?
    Use a for loop when you know exactly how many times you want to repeat something, like iterating through a list of 10 items. Use a while loop when the number of repetitions depends on a condition, such as 'while score < 100: keep playing'. In the exam, if you're counting through a fixed range, for is clearer; if you're waiting for a user input or a random event, while is better. Remember to avoid infinite loops by ensuring the condition eventually becomes false.
    What is a trace table and how do I use it in the exam?
    A trace table is a way to manually track the values of variables as a program runs, step by step. You draw a table with columns for each variable and a column for output. As you 'execute' each line of code, you update the table. This helps you find logic errors and is often required in exam questions to show your working. For example, if a program calculates the average of numbers, a trace table shows how the total and count change with each input.
    How do I handle file errors in Python for the GCSE exam?
    Use a try-except block to catch errors like FileNotFoundError. For example: try: with open('data.txt', 'r') as file: content = file.read() except FileNotFoundError: print('File not found'). This prevents the program from crashing. In the exam, you might be asked to write code that safely reads a file, so always include error handling. Also, remember to close files (or use 'with' which does it automatically) to avoid data loss.
    What is the difference between a list and a dictionary in Python?
    A list is an ordered collection of items accessed by an index (position), e.g., myList[0] gets the first item. A dictionary stores key-value pairs, accessed by a unique key, e.g., myDict['name'] gets the value associated with 'name'. Lists are best for sequences of data, like a list of scores. Dictionaries are best for structured data, like a student record with name, age, and grade. In the exam, you need to choose the right data structure for the problem.
    How can I get full marks on the 6-mark programming question?
    Start by reading the question carefully and identifying inputs, processes, and outputs. Write a clear algorithm in pseudocode or a flowchart first. Then write the code, using meaningful variable names and comments. Include validation (e.g., check input is positive) and handle edge cases (e.g., empty list). Test your code mentally with a trace table. Even if you can't finish, showing correct use of loops, selection, and subprograms will earn marks. Practice past paper questions to get used to the format.