8.1 Flashcards
Decomposition
when you break a problem down into smaller tasks so that it is easier to solve.
Abstraction
when you ignore unnecessary information and focus only on the important facts.
Sequence
Structuring code into a logical, sequential order.
Selection
making decisions using if statements.
Iteration
Repeating code using for loops or while loops.
Self-Documenting Identifiers
An identifier (variable name) is self-documenting if it clearly states its purpose.
why is self-documenting identifiers is good practice
- Code is easier to read and understand.
- It is easier to debug errors as it is clear what each identifier is.
- Further comments are not required if code is clearly self-identified.
A constant
data that is fixed and remains the same while the program is running.
A rogue value
an unexpected value that will cause a loop to end.
Annotation
Comments to make the program easier to read.
Assignment
When a variable is assigned a value.
Declaration
Declaring the data type of a variable.
Incrementation
When a value is increased - usually by 1.
Local variables
Declared within a specific subroutine and can only be used within that subroutine.
Global variables
Can be used at any point within the whole program.