Algorithm
Algorithm
- Algorithm is the step by step method that is used to solve a problem.
- Stages of solving a problem using computer
2.Developing an algorithm for the problem.
3.Writting a computer program.
4.Testing the program.
- The method that is used to solve the problem is called "Algorithm"
- An algorithm can be represented in two ways
2.Textually
- Flowchart is a graphical representation of the algorithm.
- Pseudo code is a textual representation of the algorithm.
- Pseudo code help for all people could read and understand.
For example: Design an algorithm for adding three subject marks?
Input: 3 subjects marks
Processing: Adding marks of 3 subjects
Output: Total marks of three marks.
The components of pseudo code
- Variables
- Input/Output
- Assignment
- Selection
- Repetition
Variable
- Variable is used to store information and manipulate in computer program.
Input/Output
- Input is a data which is gain from environment.
- Output is a information. (Processed data)
Sequence
- Describe the flow of program.
- Typically executed inorder.
Selection
- Also called conditional statement.
- Performs true or false test.
- Determines which code to execute next.
Repetiton
- Also called looping structure.
- Repeats a selection of ports until an exist.
Selection Statement
If <condition> Then
Statement
Else
Statement
End if
No comments: