Read, analyse and refine programs (Edexcel GCSE Computer Science): Flashcards

📚Flashcards
Read, analyse and refine programs
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

13 cards from this deck

Show

'Read' in code analysis

Examining code to understand what it does and how it works

'Analyse' in code analysis

Identifying problems, inefficiencies, or areas to improve

'Refine' in code analysis

Making changes to improve the program

Requirement when refining code

Must still meet all specified requirements

Why multiple if statements inefficient for ranges

Check every condition even after finding correct range

Advantage of if...elif...else over multiple if

Stops checking conditions once correct range is found

When to use if...elif...else

For mutually exclusive conditions

Better than many separate variables for similar data

Lists and loops

Python function to add numbers in a list

sum()

Code pattern: repeated similar code solution

Simplify using loops or functions

Code pattern: inefficient conditionals solution

Use if...elif...else instead of multiple if statements

Code pattern: poor data storage solution

Use lists, dictionaries, or other data structures

What refined code must still produce

Same correct output

Join 100,000+ GCSE students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.