0% found this document useful (0 votes)
3 views20 pages

Understanding Algorithms and Flowcharts

The document provides an overview of algorithms and flowcharts, detailing their definitions, characteristics, and advantages. It explains how to write algorithms and the types of control structures used in programming. Additionally, it highlights the significance of flowcharts in visualizing problem-solving processes and their role in program development and maintenance.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views20 pages

Understanding Algorithms and Flowcharts

The document provides an overview of algorithms and flowcharts, detailing their definitions, characteristics, and advantages. It explains how to write algorithms and the types of control structures used in programming. Additionally, it highlights the significance of flowcharts in visualizing problem-solving processes and their role in program development and maintenance.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Algorithm and

FlowChart

Module 5a: Algorithm and Flow Chart


Objectives
• Understand Algorithm
• Understand Flow Chart
• Understand how to write pseudocode
Algorithm
➢The word “algorithm” relates to the name of the mathematician
Al-khowarizmi, which means a procedure or a technique.
Software Engineer commonly uses an algorithm for planning and
solving the problems. An algorithm is a sequence of steps to solve
a particular problem or algorithm is an ordered set of
unambiguous steps that produces a result and terminates in a
finite time
Characteristics of Algorithm
➢Algorithm has the following characteristics
➢Input: An algorithm may or may not require input
➢Output: Each algorithm is expected to produce at least one
result
➢Definiteness: Each instruction must be clear and
unambiguous.
➢Finiteness: If the instructions of an algorithm are executed, the
algorithm should terminate after finite number of steps
Types of Control Structures
➢Sequence: In the sequence structure, statements are placed one after
the other and the execution takes place starting from up to down.
➢Branching (Selection): In branch control, there is a condition and
according to a condition, a decision of either TRUE or FALSE is
achieved. In the case of TRUE, one of the two branches is explored; but
in the case of FALSE condition, the other alternative is taken. Generally,
the ‘IF-THEN’ is used to represent branch control.
➢Loop (Repetition): The Loop or Repetition allows a statement(s) to be
executed repeatedly based on certain loop condition e.g. WHILE, FOR
loops
Advantages of an Algorithm
➢It is a step-wise representation of a solution to a given problem,
which makes it easy to understand.
➢An algorithm uses a definite procedure.
➢ It is not dependent on any programming language, so it is easy to
understand for anyone even without programming knowledge.
➢ Every step in an algorithm has its own logical sequence so it is
easy to debug
How to Write and Algorithm
Step 1 Define your algorithms input
Step 2 Define the variables
Step 3 Outline the algorithm's operations
Step 4 Output the results of your algorithm's operations
FlowChart
➢The first design of flowchart goes back to 1945 which was
designed by John Von Neumann. Unlike an algorithm, Flowchart
uses different symbols to design a solution to a problem. It is
another commonly used programming tool. By looking at a
Flowchart one can understand the operations and sequence of
operations performed in a system. Flowchart is often considered
as a blueprint of a design used for solving a specific problem.
Advantages of FlowChart
➢Flowchart is an excellent way of communicating the logic of a
program.
➢Easy and efficient to analyse problem using flowchart.
➢During program development cycle, the flowchart plays the role of
a blueprint, which makes program development process easier.
➢ After successful development of a program, it needs continuous
timely maintenance during the course of its operation. The
flowchart makes program or system maintenance easier.
➢It is easy to convert the flowchart into any programming language
code
Flow Chart
Symbols
Mathematical Operator
Relational Operators
Logical Operator
Selection Control Statement
Loop and Control Statement
Algorithm
and
FlowChart
Exercise 1a
Algorithm
and
FlowChart
Exercise 1b
Algorithm to
find the
smallest
Number
Algorithm to
Find the
Largest
Number
Exercises
➢Problem Solving 1
➢Problem Solving 2
➢Problem Solving 3

You might also like