flowchart
flowchart
• What is flowchart?
• A flowchart is a picture of a problem solving process.
• A flowchart gives a step by step procedure for solution of a problem.
Flowchart
• A flowchart is a picture of a problem solving process.
• A flowchart gives a step-by-step procedure for solution of a problem.
• Elements of flowchart:
• Various geometrical shaped boxes represent the steps of the solution.
• The boxes are connected by directional arrows to show the flow of the
solution.
• Flowcharts are used to:
• Specify the method of solving a problem.
• Plan the sequence of a computer program.
• Communicate ideas and solutions.
Algorithm
• What is algorithm?
• Algorithm is a logical sequence of discrete steps that describe a complete
solution to a given problem in a finite amount of time.
• Uses of Algorithm
• Algorithms are used in all types of programming. There are standard, efficient
algorithms available for a variety of tasks. Example, Search Engine, Weather
forecasting, Sorting, Pattern Recognition etc.
Developing an Algorithm
• Step 1: Obtain a description of the problem – Detailed description aids to better solution.
• Step 2: Analyze the problem – Analyze to figure out what is to be calculated or produced for a given set
of input conditions/ values. Check if any data is dependent on other data or not.
• Step 3: Develop a high-level algorithm – Come up with and develop a high-level algorithm that includes
the major part of a solution.
• Step 4: Refine the algorithm by adding more detail – Refine the algorithm and include minor steps.
• Step 5: Review and test the algorithm – Review the algorithm’s steps carefully and test it with the
sample test it with the sample set of values whether it producing correct result or not.
Geometrical shapes used in flowcharts:
- Ellipse used to show start and end of procedure in flowchart.
Yes
- A diamond shape with two branches is used to show the decision making
No step in a flowchart.
Discuss steps to add two number
Start
A=125
B=250
Sum=125+250
Sum=375
End
Draw a flowchart and develop an algorithm to
show Addition of two numbers.
Start Start Algorithm
Read B
Sum=A+B
Print Sum
End
Geometrical shapes used in flowcharts:
No
Question
Yes
Discuss steps to add two number
Start Start
A=125 Read A
B=250 Read B
Sum=125+250 Sum=A +B
End
End
Write an algorithm and Draw a flowchart to
find Maximum from two numbers
Algorithm Start
1.Start Read A
2.Read two numbers
3.Compare both the Read B
numbers. No Print B is
IF A>B
4.Display the maximum Yes
greater