Paper 2 Flashcards
Algorithm
Algorithmic thinking is solving problems by defining the steps and the sequence needed.
Abstraction
Abstraction is removing unnecessary detail from a problem.
Decomposition
Decomposition is breaking a problem into sub- problems that each represent a specific task.
High level advantage
- HIGH-LEVEL
- Like written English
- More readable
- Portable-can run on many CPUs
- Slower to execute
Translator
It translates a high-level language program into a machine language program that the (CPU) can understand. It also detects errors in the program
Compliers
High-level Machine code
-The whole program is validated so there are no system errors.
-The executable file is enhanced by the compiler, so it runs faster.
-User do not have to run the program on the same machine it was created.
interpreter
adavantages
advantages
-You discover errors before you complete the program, so you learn from your mistakes.
-Program can be run before it is completed so you get partial results immediately.
-You can work on small parts of the program and link them later into a whole program.
Interpreter disadvantages
disadvantages
Interpreted code runs slower than compiled code. the interpreter has to analyse and convert each line of source code into machine code before it can be executed.
-There’s a possibility of syntax errors on unverified scripts.
-Program is not enhanced and may encounter data errors.
-It may be slow because of the interpretation in every execution.
truth table purpose
- To show all possible inputs (to the logic circuit)…
*and the associated/dependent output (for each
input)
Give two ways that the maintainability of this program could be improved
-Use loop / iteration
-Add comments
-sequence
advantages of merge sort
Merge individual elements into sorted lists of size 2
Merge lists of size 2 into sorted lists of size 4
Merge lists of size 4 into final sorted list.
difference between function and producure
Function returns a value
Procedure does not return a value
advantages of sub programs
Easier to maintain
…as code is easier to understand/read
…as code is shorter
Avoid repetition of code (in the same program)
…makes program shorter / smaller
… subprogram called instead of copying/pasting.
… quicker to develop (new) programs
2 defensive design
Input sanitisation
…cleaning up input data / removing unwanted data
Validation
…checking whether input data should be allowed / is
sensible / follows criteria
difference between iterative and final testing
Iterative is during development // repeatedly testing
after/while making changes
* Final is when the development is (almost) complete //
done after iterative testing