Presentation is loading. Please wait.

Presentation is loading. Please wait.

Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It.

Similar presentations


Presentation on theme: "Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It."— Presentation transcript:

1 Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It involves identifying the variable names and types that would be used for solving the problem.

2 Example of algorithm Step 1=Accept the as first integer from the user.(num1) Step 2=Accept the second integer as input from the user.(num2) Step 3=Calculate the sum of the two integer. Step 4=Display sum as the result.

3 Characteristic The instruction must be in an ordered form.
The instruction must be simple and concise. They must not be ambiguous. There must be an instruction for program termination. The repetitive programming constructs must possess an exit condition.Otherwise,the program might run infinitely. The algorithm must completely and definitely solve the given problem statement.

4 Advantages It provides the core solution to a given problem. This solution can be implemented on a computer system using any programming languages of user’s choice. It ease identification and removal of logical errors in a program. It facilitates algorithm an analysis to find out the most efficient solution to a given problem. It ensures easy comprehension of a problem solution as compared to an equivalent computer program.

5 Disadvantages In large algorithm, the flow of program control becomes difficult to track. Algorithms lack, visual representation of programming construct like flowchart; thus ,understanding the logics becomes relatively difficult.

6 Flowcharts A flowchart is the graphical representation of the flow of control and logic in the solution of a problem. The flowchart is a pictorial representation of an algorithm.

7 Symbols used in flowchart
1. or Start and end: It represent starting and ending of a process in flowchart. 2. Input and output: It represent Input and output given by the by the user to the process.

8 3. Action or Process: It represents logic,action and calculation taking place in a process. 4. Decision and condition: It represents the condition or the decision making step in a flowchart

9 5. Arrow: It represents the flow of process and the sequence of steps In a flowchart. 6. Connecter: It represents the continuation of the flow of steps When a flowchart continues to the Next page.

10 Average=(marks1+marks2+
Example of flowchart Flowchart to find the ay average of marks obtained by a student. Starts Read marks1,marks2,marks3 Average=(marks1+marks2+ +marks3)/3 Display average Stop

11 characteristics It must begin with a “Start” and end with a “stop” symbol. The standard process flow should be either from top to bottom or form left to right. The instruction specified in the flowchart must be crisp and concise. The arrow must be aligned properly so as to clearly depict the flow of program control. The use of connecter should be generally avoided as they make the program look more complex. A process or action flowchart symbol must have only one input arrow and output arrow.

12 Advantages It helps to understand the flow of program.
It helps in avoiding semantic errors. A flowchart acts as documentation for the process . The use of flowcharts works well for small program design.

13 Disadvantages For a large program, the flow chart might become very complex and confusing. Modification of a flowchart is difficult and requires almost an entire rework. Excessive use of connectors in a flowchart may at times confuse the programmers.

14 Thank you


Download ppt "Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It."

Similar presentations


Ads by Google