2.1 Flashcards
name the principles of computational thinking.
- abstraction
- decomposition
- algorithmic thinking
what is abstraction?
- the process of removing unnecessary details and including only the relevant details.
what is decomposition?
The process by which a complex problem or system is broken down into parts that are easier to conceive, understand, program and maintain.
what is algorithmic thinking?
A way of getting to a solution by identifying the steps needed.
state an example of abstraction.
- maps
state an example of decomposition.
the steps taken in crossing a road
state an example of algorithmic thinking.
- a recipe
define problem inputs.
Any information or data which goes into a system
define problem processes.
Anything which happens to data during a system running e.g. performing calculations
define problem outputs.
Any information of data which leaves a system
why do we use trace tables?
We use trace tables to test algorithms, in order to make sure that no logical errors occur while the program is being processed, the table usually makes sure that no logical errors occur whilst the algorithm is being processed. The table usually has one column for each variable. Each row of the table shows how the various values held in variables change as the algorithm is running.
write a step by step guide on how to create a trace table.
- take each line at a time and write out in a trace table the constant state of each variable.
- note down any output the program produces.
- each variable present in the program should have its own column in the trace table
- a new row should be added under any column if the state of a variable changes.
what are the three different types of errors?
- syntax
- logic
- run time
define syntax error.
Errors that break the grammatical rules of the programming language and stop it from being run.
define logic error.
Errors which produce unexpected output, but on their own, they won’t stop the program from running.