Algorithms 2.1 Flashcards
Define Computational Thinking
The thought processes involved in formulating a problem and expressing its solution(s) in such a way that a computer—human or machine—can effectively carry out.
Give 2 examples of computational thinking
Could be solving a jigsaw puzzle or playing with lego.
Define abstraction
Removing unnecessary details and keeping only relevant ones.
Give an example of abstraction
Sat-nav
Define decomposition
The process by which a complex problem or system is broken down into parts that are easier to conceive, understand, program and maintain
Give an example of decomposition
Getting to school
Define algorithmic thinking and give an example
A way of getting to a solution by identifying the steps needed. An example of this is solving a math problem.
Define a syntax error and identify an example of one in programming.
An input by the programmer/user that does not comply with the laws of that programming language. e.g. pRint(). To fix them just change the statement so it follows these laws.
Define a logic error and identify an example of one in programming.
An error in the program that does not stop the program but produces an unexpected output. An example of this could be using + instead of - or using // instead of /.
Terminal symbol and its purpose
An oval - indicates the beginning and end of a program.
Input/output symbol and its purpose
A parallelogram - identifies any input needed and when output is displayed.
Process symbol and its purpose
A rectangle - marks when a calculation or a process is carried out.
Subroutine symbol and its purpose
a rectangle with tramlines at either ends - used when a subroutine is needed that is not part of the main program.
A decision symbol and its purpose
a rhombus - acts as an if statement in the program.
line symbol and its purpose
An arrow - shows the direction of code flow.
Step by step how to complete a trace table
Create a column of each variable in the program and any inputs and outputs. When the state of a variable changes, mark that value in a new row under that column and mark and output taken. Work through the program like a computer would do until the program ends. This allows you to check for any logic errors in your program.
Define a trace table
A technique used to test algorithms, in order to make sure that no logical errors occur while the algorithm is being processed.
How to identify an input
look in the program for an input statement showing what data type it is and what input message is being displayed.
How to identify a process
see if the variable name for an input or a value changes in the program. This is usually a calculation.
How to identify an output
look for a statement that includes the following:
print()
output
return