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

2 Flowchart

Here is a flowchart to determine whether a number is positive, negative or zero: Start Input a number Is the number greater than 0? Yes No Print Is the number "Positive" equal to 0? Yes No Print Print "Zero" "Negative" Stop This flowchart takes a number as input, then uses decision symbols to check if the number is greater than 0, equal to 0, or less than 0 (negative) to determine whether it should print "Positive", "Zero" or "Negative" respectively before stopping.

Uploaded by

bishnoisumit1229
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

2 Flowchart

Here is a flowchart to determine whether a number is positive, negative or zero: Start Input a number Is the number greater than 0? Yes No Print Is the number "Positive" equal to 0? Yes No Print Print "Zero" "Negative" Stop This flowchart takes a number as input, then uses decision symbols to check if the number is greater than 0, equal to 0, or less than 0 (negative) to determine whether it should print "Positive", "Zero" or "Negative" respectively before stopping.

Uploaded by

bishnoisumit1229
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

INSTITUTE - UIE

DEPARTMENT- ACADEMIC UNIT-2


Bachelor of Engineering (Computer Science & Engineering)
Subject Name: Introduction to Problem Solving
Code:23CSH-101

Flowcharts DISCOVER . LEARN . EMPOWER


Introduction to
Problem Solving

Course Objectives

The course aims to provide exposure to problem-


solving through programming.

The course aims to raise the programming skills


of students via logic building capability.

With knowledge of C programming language,


students would be able to model real world
problems.
2
Course Outcomes
CO Course Outcome
Number

CO1 Remember the concepts related to fundamentals of C language,


draw flowcharts and write algorithm/pseudocode.
CO2 Understand the way of execution and debug programs in C
language.
CO3 Apply various constructs, loops, functions to solve mathematical
and scientific problem.
CO4 Analyze the dynamic behavior of memory by the use of pointers.

CO5 Design and develop modular programs for real world problems
using control structure and selection structure.

3
Scheme of Evaluation

4
What
A flow chart is a graphical or symbolic
representation of a process. Each
step in the process is represented by
a different symbol and contains a
short description of the process step.
The flow chart symbols are linked
together with arrows showing the
process flow direction. Why
This diagrammatic representation
illustrates a solution model to a given
problem. Flowcharts are used in
analyzing, designing, documenting or
managing a process or program in
various fields.

5
Uses of Flowchart:
•Planning a new project.
•Documenting a process.
•Modeling a business process.
•Managing workflow.
•Auditing a process.
•Mapping computer algorithms.
•Data management.
•Chemical and process engineering.

6
• Space for visual (size 24)

CONTENTS

• Introduction to Flowcharts
• Symbols used in flowcharts
• Example Flowcharts

7
FLOWCHART
• A flow chart is a graphical or symbolic
representation of a process. Each step in the
process is represented by a different symbol and
contains a short description of the process step.
• It uses several geometrical figures to represent
the operations, and arrows to show the direction
of flow.
• The flow chart symbols are linked together with
arrows showing the process flow direction.

8
Flowcharts
Symbols:

9
10
IDEA OF FLOWCHART
Oval shaped symbol is used to denote the start/end
of program

This symbol is used to show the I/O performed

This symbol is used to show the process

This symbol represents the point where decision is


made

This symbol is used to show the I/O performed

Oval shaped symbol is used to denote the start/end


of program
11
EXAMPLES OF FLOWCHART AND
ALGORITHMS
Example: Add 10 and 20
• Start
• Initialize sum = 0 (PROCESS)
• Enter the numbers (I/O)
• Add them and store the result in sum (PROCESS)
• Print sum (I/O)
• Stop

Figure 1.9 flowchart for addition of two


12
numbers
EXAMPLE: CALCULATE INTEREST OF
BANK DEPOSIT
Algorithm:
• Step 1: Start
• Step 2: Read amount,
• Step 3: Read years,
• Step 4: Read rate,
• Step 5: Calculate the interest with formula
Interest=Amount*Years*Rate/100
• Step 6: Print interest
• Step 7: Stop

Figure 1.10 flowchart to calculate interest rate 13


DETERMINE WHETHER THE NUMBER
IS EVEN OR ODD
Algorithm:
• Step 1: Start
• Step 2: Read number N,
• Step 3: Set remainder as N modulo 2,
• Step 4: If remainder is equal to 0 then
number N is even, else number N is
odd.
• Step 5: Print output.
• Step 6: End

Figure 1.11 flowchart for even/odd 14


DETERMINE WHETHER TEMPERATURE
IS ABOVE OR BELOW FREEZING POINT
Algorithm:
• Step 1: Start
• Step 2: Input temperature,
• Step 3: If it is less than 32,
then print "below freezing point",
otherwise print "above freezing point“
• Step 4: End

Figure 1.12 flowchart to determine temperature


15
DETERMINE WHETHER STUDENT
PASSED THE EXAM OR NOT
Algorithm:
• Step 1: Start
• Step 2: Input grades of 4 courses M1, M2, M3
and M4,
• Step 3: Calculate the average grade with formula
Grade=(M1+M2+M3+M4)/4
• Step 4: If the average grade is less than 60, print
"FAIL", else print "PASS".
• Step 5: End

Figure 1.13 flowchart to print pass/fail 16


Print Hello World 10 times
• Start
• Initialize count = 0 (PROCESS)
• Print Hello World (I/O)
• Increment count by 1 (PROCESS)
• Is count < 10 (DECISION)
• if YES go to step 2
else Stop
• Stop

Figure 1.14 flowchart to print hello 10 times 17


Key Differences Between Algorithm and
Flowchart
• An algorithm involves a combination of sequential steps to interpret the logic of
the solution. In contrast, a flowchart is the pictorial illustration of the algorithm.
• A flow chart is more understandable as compared to the algorithm.
• The algorithm is written in a language that can be perceived by humans. On the
other hand, the flowchart is made up using different shapes and symbols.
• There are no stringent rules are implemented in the algorithms while the
flowchart is abode by predefined rules.
• Errors and bugs are easily detected in the algorithm as compared to the flow
charts.
• Flow charts are simple to create. On the contrary, the construction of the
algorithm is complex.
18
ADVANTAGES OF FLOWCHART
• It is a convenient method of communication.
• It indicates very clearly just what is being done, where a program has
logical complexities.
• A key to correct programming.
• It is an important tool for planning and designing a new system.
• It clearly indicates the role-played at each level.
• It saves the inconveniences in future and serves the purpose of
documentation for a system.
• It provides an overview of the system and also demonstrates the
relationship between various steps.
• Facilitates troubleshooting.
• It promotes logical accuracy.
• It makes sure that no logical path is left incomplete without any action
being taken.
19
DISADVANTAGES
• The flowchart is a waste of time and slows down the
process of software development.
• The flowchart is quite costly to produce and difficult to
use and manage.
• Flowcharts are not meant for man to computer
communication.
• Sometimes the Complex logic of the program logic is
quite complicated to draw out on by using different
defined shapes. In that case, flowchart becomes
complex and clumsy. This will become a pain for the
user, resulting in a waste of time and money trying to
correct the problem
• If you need to modify or alternate the process then it
will be very hard to do in the flowchart. Because either
you will have to erase the end of the flowchart or start.
20
Summary

In this lecture we have In this lecture we have learnt


discussed about need and use how to design flowchart , how
of flowcharts to use specific symbol .

We have also discussed some


advantages , disadvantages
and applications of Flowcharts

21
Frequently Asked question
Q1: What is a sub-process in a flowchart?
Answer: Sometimes complex processes are broken down into smaller sub-processes for
clarity. So a flowchart can point to a different sub process within its flow. The predefined
process symbol is used to show such sub-processes.
Q2: How are flowcharts used in computer programming?
Answer: A computer program consists many processes and flows. Flowcharts are used to
visualize the processes and make it understandable for nontechnical people. They are also
used to visualize algorithms and comprehend pseudo code which is used in programming.
Q3: Which online tools can I use to create flowcharts?
Answer: There are numerous tools which you can find easily. Some of them are: Raptor,
Visual Paradigm, Gliffy, and Creately

22
Q4: Draw the flowchart to
represent the sum of two
numbers.

23
Q5 Draw the flowchart to calculate profit and Loss.
Answer: Flowchart –Calculate Profit and Loss
The flowchart example below shows how profit and loss can be calculated.

24
Assessment Questions:
1. The symbol denotes ______
a) I/O
b) Flow
c) Terminal
d) Decision

2. The box denotes?


a) Decision
b) Initiation
c) Initialization
d) I/O

3. Design a flowchart to check leap year

4. Design a flowchart to find sum of n natural numbers

5. Design a flowchart of Quadratic equation


25
Discussion forum.
Students please have a look at this Medical Service Flowchart and try to
improve it.

26
REFERENCES
Reference Books:
[1] Programming in C by Reema Thareja.
[2] Programming in ANSI C by E. Balaguruswamy, Tata McGraw
Hill.
[3] Programming with C (Schaum's Outline Series) by Byron
Gottfried Jitender Chhabra, Tata McGraw Hill.
[4] The C Programming Language by Brian W. Kernighan, Dennis
Ritchie, Pearson education.
Websites:
https://medium.com/@warren2lynch/a-comprehensive-guide-for-flowc
hart-over-50-examples-785d6dfdc380
https://www.geeksforgeeks.org/an-introduction-to-flowcharts/
https://www.programiz.com/article/flowchart-programming
YouTube Links:
27
Introduction to Creating Flowcharts: https://youtu.be/SWRDqTx8d4k
THANK YOU

You might also like