DC MACHINE-Motoring and generation, Armature circuit equation
Flowcharts
1. FLOW CHARTS
Mrs Parimala G
Assistant Professor,
Department of Computer Science & Engineering
Vignan’s Foundation for Science, Technology and Research
3. OVERVIEW
Flowcharts are the graphical representation of a solution to a
particular problem which comes under the
category of Programming Practices and Techniques.
In simple word flowchart is a graphical representation of
a program.
Flowcharts are Symbolic diagrams which shows type of
data(numeric, character etc),data flow, control flow and
programming logic.
4. The first flowchart was created
by Von Neuman in 1945.
Flowcharts are important for planning
and working of a program.
Flowcharts decreases our efforts i.e they
are easy to understand and check the
logics and algorithms.
5. A FLOWCHART
Shows the logic of an
algorithm.
Emphasizes individual steps
and their interconnections.
E.g: control flow from one
action to the next
6. ADVANTAGES & DISADVANTAGES
Advantages:
A good way to communicate the details of a task or
process to others.
An excellent way of documenting each stage of the
process.
Acts as a blue print to guide the programmer through
the development.
Disadvantages:
Some tasks are difficult to represent.
If an alteration is made the flowchart need to be
redrawn.
8. 1. TERMINAL
This symbol shows the beginning or ending of
a program i.e. first and the last element
of flowchart.
It is single directional i.e. only one flow
line(either incoming line or outgoing line)
can be connected with terminal symbol.
9. 2. INPUT/OUTPUT SYMBOL
A parallelogram is used to represent
input and output operation, it can
have 2 flow lines(in coming & out
going lines).
10. 3. PROCESS SYMBOL
This symbol is used for showing mathematical
calculation, change in data or any type of
processing on data, it can have 2 flow
lines(incoming line or outgoing line).
11. 4.FLOW LINE :
A straight line between two symbols
shows the logical flow of control in
a program is flow line.
12. 5. DECISION SYMBOL
Diamond symbol is used to show or
apply condition , it has single flow line
for input and two flow lines for output
i.e. one for true part and one for false
part.
13. 6. CONNECTOR SYMBOL
Connector symbol (circle) are
used to connect separate
portions of flow chats, it can
have single flow line(either in
coming line or out going line).
16. 1. SEQUENTIAL FLOWCHART
As the name suggests, the
control flow and data flow is
sequential in sequential
flowchart.
17. EXAMPLE 1: ADDITION OF TWO NUMBERS
Algorithm
Step 1: Start
Step 2: take first number(assume as
a)
Step 3:take second number(assume
as b)
Step 4:add to above two
number(assume as c)
Step 5: display the result/output( c )
Step 6: Stop
Flowchart
START
Read 1st number( a)
Read 2nd number( b)
c=add a & b
Display the output( c)
STOP
a= 5
b=7
c=5+7
c=12
18. EXAMPLE 2:CALCULATE THE INTEREST OF A
BANK DEPOSIT.
Algorithm
Step 1: Start
Step 2: Read amount(amt)
Step 3: Read years(years)
Step 4:Read rate(rate)
Step 5:calculate the interest
(interest=amt*years*rate/100)
Step 6 : print intersest
Step 7: Stop
Flowchart
START
Read amount(amt)
Read years(years)
Read rate(rate)
Interest=(amt*years*rate)/10
0
Stop
Print Interest
19. 2. SELECTIVE FLOWCHARTS
Selection Logic simply involves a number of
conditions or parameters which decides one
out of several written modules. The structures
which use these type of logic are known
as Conditional Structures.
20. EXAMPLE 3:FLOWCHART FOR DETERMINING
WHETHER THE ENTERED NUMBER IS EVEN OR
ODD
Algorithm
Step 1: Start
Step 2:Take integer variable A.
Step 3: Perform modulo division 2
on the given value.
Step 4:if the reminder is = 0, then
Step 5: entered number is even
Step 6: else
the entered number is odd.
Step 7: STOP
Flowchart
Start
Read an input(n)
n%2
==0
n is even n is odd
stop
Yes no
n=6
6%2
n is even
n=15
15%2
n is odd
= 0 ≠ 0
21. 3. RECURSIVE FLOWCHART
Recursion is the process which comes into existence when
a function calls a copy of itself to work on a smaller
problem.
Recursion is a programming technique that allows the
programmer to express operations in terms of themselves.
Simply we can say that a recursion is a “function which
calls itself”.
But while using recursion, programmers need to be careful
to define an exit condition from the function, otherwise it
will go into an infinite loop.
22. FLOWCHART FOR FINDING THE SUM OF N
NATURAL NUMBERS
Algorithm
Step 1: Start
Step 2: Read the value of n (let n=5).
Step 3: i = 1 , SUM = 0
Step 4: while if ( i > n )
then goto step 8
Step 5: Sum = Sum + I
Step 6: i = i + 1
Step 7: go to 4
Step 8: Display the value of Sum
Step 9: Stop
Flowchart
start
i=1,sum=0
If
i>n
Sum=sum+i
Print sum
stop
i=i+1
no yes
i=1
i=2
i=3
i=4
i=5
i=6
Take a number
assume n=5
Sum=1 Sum=3
Sum=6 Sum=10
Sum=15
i=6
Sum=15
23. EXERCISE
What is the flowchart for reading 6
subject marks of a student and to find
the average.
What is the flow chart to find the largest
among three different numbers entered
by the user.
What is the flowchart for finding the
Fibonacci sequence.