2.1.4 Thinking Logically Flashcards
1
Q
Thinking Logically
A
Thinking Logically :
- Identify points where decisions must be taken - e.g. boolean conditions in sequence, selection or iteration
(e.g. Does … need to be shown/output)
- Program uses structured programming techniques including:
Sequence: code executed line by line
Selection: If statements that branch if a condition is met
Iteration: Loops that repeat code while condition is met or set number of times - Determine logical conditions that affect the outcome of a decision
(e.g. most effective/convenient)
2
Q
Thinking Logically - Determine how decisions affect the flow through a program
A
Determine how decisions affect the flow through a program :
- Allows you to tackle programs effectively and determine which parts can be tackled simultaneously
Allows to develop Good algorithm which has :
- Clear precisely stated steps that produce correct output for inputs.
- Doesn’t allow invalid inputs.
- Must terminate eventually.
- Execute efficiently in as few steps as possible.