Component 2.2 - Algorithms And Programming Constructs Flashcards
What is an algorithm?
An algorithm is a set of instructions that can be used to solve a given problem
What two things must the instructions of an algorithm be?
- clear
- in the correct order to produce the solution
Algorithms are a ___ for writing a computer program to ___
Starting point, solve the given problem
What programming language should an algorithm be presented in?
Algorithms should be presented in a way that it can be used in different programming languages. It should NOT be in computer code
What is pseudo code?
Pseudo code is a way of writing instructions in plain english
What is a flowchart?
A flowchart is a diagram showing the instructions to be carried out in the order they should be carried out
What 3 things must a good algorithm be?
- Be finite - must not never end trying to solve a problem
- have well defined instruction (each step must be clear)
- be effective (it should give the correct result/solution)
What does a rounded rectangle mean in a flowchart?
Start/stop
What does a diamond mean in a flowchart?
Decision
What does a parallelogram mean in a flowchart?
Input/Output
What does a rectangle mean in a flowchart?
Operation
What does a circle mean in a flowchart?
Connector
What does a rectangle with two lines near each end mean in a flowchart?
Store/call subroutine
What are the three basic constructs used to design algorithms?
Sequence, selection and iteration
What is the sequence construct of an algorithm?
Algorithms consist of a series of instructions in a specific order. It is the sequence in which instructions must be carried out for the algorithm to work.