SLIDE 1
CSZone.co.uk
Click to advance · Arrow keys also work
Edexcel 1CP2 · Topic 6 · 6.6

Programming Project
Guidance

Decomposition · Planning · Coding Best Practice · Documentation · Evaluation

CSZoneEdexcel GCSE Computer Science 1CP2
Decomposing the Problem

Breaking It Down

Decomposition: break a large problem into smaller, manageable sub-problems. Each sub-problem becomes a function or subroutine. This makes the program easier to build, test, and debug.
Plan on paper before you code — structure charts, flowcharts, or pseudocode
Identify inputs, processes, and outputs before writing any Python
Write each subroutine separately and test it before connecting them
Coding Best Practice

Writing Good Python Code

# Good practice example
MAX_ATTEMPTS = 3 # named constant

def get_valid_age(): # clear function name
"""Get and validate user age.""" # docstring
age = int(input("Enter age: "))
while age < 0 or age > 120:
print("Invalid age. Try again.")
age = int(input("Enter age: "))
return age # returns validated value
Meaningful variable names: student_score not x
Comments: explain why, not what — code should be self-documenting where possible
Modular design: each function does ONE thing — easy to test and reuse
Evaluation & Improvements

Reflecting on Your Project

Does the program meet all the requirements set out in the analysis?
Is it robust? Does it handle invalid input without crashing?
Is it efficient? Are there any repeated sections that could be functions?
Is it readable? Would another programmer understand your code?
Suggest improvements — e.g. add a GUI, save to file, improve input validation
Exam Practice

Have a go at this question

Edexcel-style question
A student has written a program but used single-letter variable names throughout. Describe two ways they could improve the quality and readability of their code.
4 marks
Use meaningful variable names that describe what the value represents [1] — e.g. student_score instead of s, so code is self-documenting [1]. Add comments to explain complex logic [1] so other programmers (or the student themselves) can understand the code months later [1].
Key Takeaways

What to Remember

Decompose: break problem into subroutines; plan before coding
Best practice: meaningful names, comments, constants, modular design, validation
Evaluate: check requirements met, robust input handling, efficiency, readability
Topic 6 overall: Python is the language for Edexcel 1CP2 — all code in exams uses Python syntax