0% found this document useful (0 votes)
31 views

Flowcharts&Pseudocode

This document discusses flowcharts and pseudocode. It introduces flowcharts, their elements and uses. It explains how to design flowcharts for algorithms. It also defines pseudocode, provides guidelines for writing pseudocode, and compares algorithms and pseudocode.

Uploaded by

manishdahiya731
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Flowcharts&Pseudocode

This document discusses flowcharts and pseudocode. It introduces flowcharts, their elements and uses. It explains how to design flowcharts for algorithms. It also defines pseudocode, provides guidelines for writing pseudocode, and compares algorithms and pseudocode.

Uploaded by

manishdahiya731
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Introduction to Flowchart

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Agenda
In this session, we will discuss:
● Introduction to Flowcharts
● Uses of Flowcharts
● Elements of Flowchart
● Designing Flowchart
● Types of Flowchart

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
What is a Flowchart?
● A flowchart is a graphical representation of a process
or algorithm.
● It uses different shapes and arrows to show the
sequence of steps involved in completing a specific
task or solving a problem.
● Flowcharts are widely used in various fields:
o Including computer programming
o Business process analysis
o Engineering
o Education
o To visually illustrate complex processes or
problems

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Elements of a Flowchart

Symbol Symbol Name Purpose

Start terminal It is used at the beginning of the


OR algorithm to show the start of the
program
Process Indicates the mathematical
operations

Input/Output It is used to denote the inputs and


outputs

Decision Used for decision statements in a


program

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Elements of a Flowchart

Symbol Symbol Name Purpose

Arrow Used to show the relationships between the


shapes

On-page Connects two or more parts of a flowchart,


Connector which are on the same page.

Stop terminal It is used at the end of the algorithm to


OR show the end of the program

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Designing Flowchart
● Algorithm to add two numbers: Fig: Flowchart to represent
o Step 1: Start the problem. Start the addition of two numbers
o Step 2: Read the values of A and B.
o Step 3: Find the sum of entered
Read A , B
numbers A and B and store the
result in C.
o Step 4: Print C. C=A+B
o Step 5: Stop the problem.

Print C

Stop

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Designing Flowchart
● Algorithm to multiply two numbers: Fig: Flowchart to represent
o Step 1: Start the problem. Start the multiplication of two
o Step 2: Read the values of A and B. numbers
o Step 3: Find the product of entered Read A , B
numbers A and B and store the result
in C.
o Step 4: Print C. C = A*B
o Step 5: Stop the problem.

Print C

Stop

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Designing Flowchart
● Algorithm to find largest of two Start Fig: Flowchart to represent
numbers: the largest of two numbers
o Step 1: Start the problem.
o Step 2: Read the values of A Read A , B
and B.
o Step 3: Compare A and B.
o Step 4: If A > B go to step 6. False True
o Step 5: Print B is Greater and
If A > B
go to step 7.
o Step 6: Print A is Greater. B is Greater A is Greater
o Step 7: Stop.

Stop
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Designing Flowchart
● Algorithm to Swap two numbers: Fig: Flowchart to represent
o Step 1: Start the problem. Start swapping of two numbers
o Step 2: Input the values of a and b.
o Step 3: c = a Read a , b
a=b
b=c
o Step 4: Print a, b. c=a
o Step 5: Stop the problem. a=b
b=c

Print a, b

Stop
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Types of Flowchart
● Process Flowchart
● Decision Flowchart
● Data Flow Diagram
● Linear Flowchart
● Workflow Diagram

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Process Flowchart
● The process flow chart provides a visual representation of the steps in a process.

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Decision Flowchart
● Decision making flowchart is a systematic procedure for solving a problem.

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Data Flowchart
● Data Flow Chart provides a visual representation of the flow of information (i.e. data) within a system.

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Linear Flowchart
● A linear flowchart is used to show the sequential order of events in a process.

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Work Flow Diagram
● A workflow diagram is a type of flowchart that serves as visual representation that shows you the
workflow of your business.

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Summary
Here’s a brief recap:
● A flowchart is a visual representation of a process or a series of steps in a clear and organized manner.
● Flowcharts employ a range of shapes to visually convey the information.
● Different types of flowcharts come with different shapes, each serving a unique purpose.
● Designing a flowchart and converting the algorithms to their corresponding flowcharts.

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Introduction to Pseudocode

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Agenda
In this session, we will discuss:
● Basics of Pseudocode
● Guidelines for Preparing Pseudocode
● Benefits of Pseudocode
● Developing a Pseudocode
● Difference between Algorithm and Pseudocode

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
What is Pseudocode?
● A pseudocode is an informal method of writing programs in a form that humans can easily understand.
● It doesn’t matter in what language you write a pseudocode, all that matters is comprehension.
● In pseudocodes, you don’t have to think about semi-colons, curly braces, and syntax as well.
● It allows you to write instructions that follow a logical pattern without including all of the technical
details in it.

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Guidelines for preparing Pseudocode
● Pseudocode should be enclosed by START (or BEGIN) and STOP (or END).
● Pseudocode should be very concise and so we have to ignore unnecessary details.
● Use statements like INPUT, READ, GET or OBTAIN to accept the data from user.
● Use statements like PRINT, DISPLAY, or WRITE to display the result or any message.
● Generally the used keywords are capitalized while developing the pseudocode.

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Benefits of Pseudocode
● Pseudocode allows the designer to focus on main logic without having to be worried about
programming languages syntax.
● They are language independent.
● It helps the designer to express the logic in plain natural language.
● It eases the job of developer in writing the actual code using pseudocode.
● They are very concise which makes the modifications easy.

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Pseudocode - Example
● Pseudocode to add two numbers:
BEGIN
NUMBER s1, s2, sum
OUTPUT("Input number1:")
INPUT s1
OUTPUT("Input number2:")
INPUT s2
sum=s1+s2
OUTPUT sum

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Pseudocode - Example
● Pseudocode to multiply two numbers:
BEGIN
NUMBER s1, s2, res
OUTPUT("Input number1:")
INPUT s1
OUTPUT("Input number2:")
INPUT s2
res=s1*s2
OUTPUT sum

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Pseudocode - Example
● Pseudocode to find largest of two numbers:
BEGIN
READ n1, n2
if n1 = n2
then print numbers are equal
if n1>n2
then print n1 is the largest number
if n2>n1
then print n2 is the largest number

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Pseudocode - Example
● Pseudocode to swap two numbers:
START
NUMBER a,b
set c=0
ca
ab
bc
then print a and b
STOP

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Difference between Algorithms and Pseudocode
Algorithms Pseudocode

An algorithm is a sequence of well- It is an informal method of writing


defined steps where these steps programs.
provide a solution.
It is a systematic approach to solve It is a simpler version of the code.
any problem.
Algorithms can be represented using It is written in plain English language.
natural language, flowchart and so
on.
Algorithms are easy to debug. Pseudocodes are relatively difficult to
debug.
The construction of algorithms are Its construction is easy.
tough.
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Summary
Here’s a brief recap:
● Pseudocode serves as a bridge between plain language explanations and actual programming code.
● It uses easy-to-understand language resembling programming logic without strict syntax rules.
● It helps programmers plan and design solutions before writing actual code.
● The designing of pseudocode involves creating a human-readable outline of the logical steps that an
algorithm will take to solve a specific problem.
● Algorithms and pseudocode are related concepts that are used in computer science and programming,
but they serve different purposes and are used at different stages of the development process.

Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.

You might also like