Thinking Logically (OCR A-Level Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
What is a decision in a program?
What is a decision in a program?
Point where next action depends on whether a condition is true or false
What is the purpose of decisions in programs?
What is the purpose of decisions in programs?
Control program flow by choosing between different paths
What do IF statements do?
What do IF statements do?
Execute a block of code if a condition is true
What does an IF-ELSE-IF ladder handle?
What does an IF-ELSE-IF ladder handle?
Multiple conditions
When to use CASE/SWITCH statements?
When to use CASE/SWITCH statements?
When checking multiple conditions against a single variable
How do decisions create branching?
How do decisions create branching?
Create multiple paths leading to different outcomes based on conditions
How do decisions affect loops?
How do decisions affect loops?
Determine how many times the loop executes
What is the flowchart symbol for decision points?
What is the flowchart symbol for decision points?
Diamond shape
What error results from misplacing decision points?
What error results from misplacing decision points?
Leads to incorrect outcomes
What is the risk of ignoring edge cases?
What is the risk of ignoring edge cases?
Failing to account for all possible conditions or inputs
What problem comes from overcomplicating decision logic?
What problem comes from overcomplicating decision logic?
Too many nested IFs make program harder to understand and debug
What is the risk of missing DEFAULT in CASE statements?
What is the risk of missing DEFAULT in CASE statements?
Can lead to unhandled scenarios
