Algorithm Design and Pseudocode Flashcards
What are the four main stages in the program development life cycle?
Analysis
Design
Coding
Testing
Define what is meant by abstraction
Identifying the key parts of a program and removing any unnecessary detail so that it becomes easier to solve
Define what is meant by decomposition
Breaking down a complex problem into smaller, manageable parts which are easier to solve
What are the main steps in decomposition?
- Identify the main problem
- Identify the component parts of inputs, processes, outputs and storage
- Break these down into smaller sub-problems
How do you declare a variable in pseudocode?
DECLARE {variablename} : {variable type}
e.g. DECLARE StartNumber : INTEGER
How can you ensure your pseudocode is easy to understand?
Add a comment to explain the purpose of that line
Ensure the variable name is meaningful
What are the six types of validation checks?
- Range check
- Length check
- Type check - Correct data type
- Presence check - String can’t be empty
- Format check
- Check digit check
What is normal (typical) data?
Using examples of data that the program is designed to handle
What is extreme data?
The largest and smallest acceptable value (e.g. 1, 50)
What is boundary data?
Includes both ends of the allowed range (e.g. 1, 50) as well as the values just outside the range (e.g. 0, 51)
What is abnormal/erroneous data?
Data of the wrong type
e.g. letters in a numerical field
What will happen to your code if it encounters a syntax error?
It will prevent the code from running
What can syntax errors be caused by?
Mistakes in spelling or ‘grammar’ in the code
What will happen to your code if it encounters a logical error?
It will continue to run but may give an incorrect or unexpected output
What can logical errors be caused by?
Using y > 5 instead of y >= 5 could affect loop conditions or range checks