Sequence and Selection (AQA GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
What are the 3 fundamental programming constructs?
What are the 3 fundamental programming constructs?
Sequence, selection, and iteration
What is sequence in programming?
What is sequence in programming?
Executing program statements one after another, in order
Why does instruction order matter in sequence?
Why does instruction order matter in sequence?
Changing the order changes the program result
What is selection in programming?
What is selection in programming?
How programs make decisions based on conditions
What is a Boolean condition?
What is a Boolean condition?
Statement that can only be True or False
Possible values for Boolean conditions
Possible values for Boolean conditions
Only True or False, never anything else
Purpose of IF statements
Purpose of IF statements
To implement selection and make decisions in code
Purpose of ELSE keyword
Purpose of ELSE keyword
Specifies what happens when condition is false
Purpose of ELSE IF (ELSIF)
Purpose of ELSE IF (ELSIF)
To check multiple different conditions in sequence
What happens after a true condition in ELSE IF chain?
What happens after a true condition in ELSE IF chain?
Rest of conditions are skipped
Common mistake with condition order in ranges
Common mistake with condition order in ranges
Checking lowest to highest instead of highest to lowest
Correct order for checking range conditions
Correct order for checking range conditions
From highest to lowest (most to least specific)
