Unit 9.2 Introduction to Algorithms
Understand what is meant by the terms input, process and output.
Understand what is meant by the term programming construct and how sequence, selection and iteration are used to structure code.
Understand what is meant by the term algorithm and the different ways to represent an algorithm.
Be able to write Structured English and draw flowcharts to represent algorithms.
Step by step description that define the logic programs will use for solving a problem or completing a task.
Developers use them to design logic/functionality of a program, then its implemented into specific programming language e.g. Python
STEPS MUST BE IN ORDER!!
Input - Data entered, can be done manually or automatically (via a sensor), often stored in either a variable or constant so the algorithm can use it.
Process - Action carried out by the algorithm such as calculation, a condition to be checked following input or data manipulation (search/store etc.)
Output - response communicated back to user or sent to another part of the algorithm.
Algorithms are structured using programming constructs (aka programming control structure) which dictate the flow and order in which different instructions are run.
Sequence - Instructions run once and in the order they are written.
Selection - When the flow is interrupted and a condition is tested. Based on outcome, control is passed to another point in the algorithm.
Iteration - When one or more instructions are repeated.
Structured English |
|
Flowcharts |
|
Pseudocode (See Unit 11) |
|
Instructions run once and one after another in order as written - ensure data has suitable identifier names - see example below.
When the flow is interrupted and a condition is tested, based on the outcome, control is then passed to onto another point in the algorithm.
Where one or more instructions are repeated
Subroutine - Flow temporarily transfers to another part of the flowchart designed to perform a particular task.
Helps to breakdown complex tasks into smaller manageable pieces and promote code reuse.
Understand what is meant by the terms input, process and output.
Understand what is meant by the term programming construct and how sequence, selection and iteration are used to structure code.
Understand what is meant by the term algorithm and the different ways to represent an algorithm.
Be able to write Structured English and draw flowcharts to represent algorithms.
Step by step description that define the logic programs will use for solving a problem or completing a task.
Developers use them to design logic/functionality of a program, then its implemented into specific programming language e.g. Python
STEPS MUST BE IN ORDER!!
Input - Data entered, can be done manually or automatically (via a sensor), often stored in either a variable or constant so the algorithm can use it.
Process - Action carried out by the algorithm such as calculation, a condition to be checked following input or data manipulation (search/store etc.)
Output - response communicated back to user or sent to another part of the algorithm.
Algorithms are structured using programming constructs (aka programming control structure) which dictate the flow and order in which different instructions are run.
Sequence - Instructions run once and in the order they are written.
Selection - When the flow is interrupted and a condition is tested. Based on outcome, control is passed to another point in the algorithm.
Iteration - When one or more instructions are repeated.
Structured English |
|
Flowcharts |
|
Pseudocode (See Unit 11) |
|
Instructions run once and one after another in order as written - ensure data has suitable identifier names - see example below.
When the flow is interrupted and a condition is tested, based on the outcome, control is then passed to onto another point in the algorithm.
Where one or more instructions are repeated
Subroutine - Flow temporarily transfers to another part of the flowchart designed to perform a particular task.
Helps to breakdown complex tasks into smaller manageable pieces and promote code reuse.