Algorithms Flashcards
Algorithm
A set of instructions to solve a problem or complete a task
Abstraction
Removing unnecessary details from a problem
Decomposition
Breaking down a large problem into smaller sub-problems
Sequence
Statements are executed in the order they were written in
Selection
Next statement depends on if condition is true or false
Iteration and examples
Repetition
-for … next
-while … endwhile
-do … until
Post-condition vs Pre-condition
Post-condition: Condition is tested at the end of a loop. Repeats loop until condition is true
Pre-condition: Condition is tested at the start of a loop. Repeats loop while a condition is true
Validation
Process of checking that data input is reasonable
Carried out by computer
Types of validation
-Range check
-Presence check
-Digit check
-Length check
-Type check
Verification and types of it
Checking if data input is correct
-Visual check
-Double entry (entering data twice and comparing them)
Normal data
Data that falls into allowed range and is of correct data type
Abnormal data
Data that falls out of allowed range and is not of correct data type
Boundary data
Upper and lower limits of accepted range
Two types:
-Accepted boundary data (First and last accepted values
-Rejected boundary data (Just outside of accepted range)
Extreme data
Same as accepted boundary data - First and last accepted values