1.3 Flashcards
Algorithm
A set of instructions designed to solve a problem
Identifier
A name given to an element of a program so it can be referred to throughout
Good Programming Practice
- Meaningful names, clear what variable is holding
- Annotation, easier for programmers to follow
- Program Layout, see each function and aids readability
Variable
An attribute within a program whose value can be reassigned (during execution)
Constant
An attribute within a program which never changes its value (during execution)
Global Variable
- Declared at the top of the program
- Available to the whole program
Local Variable
- Declared inside a subroutine
- Available only to that subroutine
Sequence
Steps processed once
Selection
- Uses a logical condition to determine which line of code to process next
- Purpose: to execute code if a certain condition is met
Nesting
When another selection statement is contained within an existing selection statement
Repetition
Purpose: to repeatedly execute code until a certain condition is met
Count
A value in a loop that will increase/decrease each time the loop is executed
Rogue Value
a value which tells the computer that input has finished
DIV
//
How many times one number goes into another
MOD
%
Remainder after DIV
Lossy Compression
- Cannot be decompressed to yield back the original data
- Not Good method for critical data such as text
- Good for digitally sampled analogue data e.g. Sound/Video/Graphics
- Algorithms vary but many use threshold truncation
Lossless Compression
- Original message can be decompressed back to it’s original form
- Good for text
- Good for high quality media e.g. .FLAC .PNG
Character Combinations (Compression)
Finding frequently occurring character combinations and replace them with tokens
Run Length Encoding
Replace long strings with a number