Breaking News
recent

Algorithm

Algorithm

  • Algorithm is the step by step method that is used to solve a problem.
  • Stages of solving a problem using computer
                    1.Analyzing the problem in terms of input, process and output.
                    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
                     1.Graphically
                     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

  1. Variables
  2. Input/Output
  3. Assignment
  4. Selection
  5. Repetition
  6.  

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.
                Example: If, Select case, Go to

Repetiton 

  • Also called looping structure. 
  • Repeats a selection of ports until an exist.
                Example: For next, do while, Do until
 

Selection Statement

 If <condition> Then
       Statement
Else
       Statement
End if

No comments:

Powered by Blogger.