Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

Lecture 2

Uploaded by

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

Lecture 2

Uploaded by

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

COLLEGE OF INFORMATICS AND VIRTUAL EDUCATION

(CIVE)

CP 123: Introduction to High-Level Programming

Problem Solving, Algorithms and General


Programming Constructs-Part2

1
Flowcharts
 A flowchart is a graphical representation of an
algorithm.
 It depicts a problem in terms of its inputs,
processes, and outputs.
 That is, it visually represents and organizes the
steps used to write the program—it is a
diagram of the “flow” of the process.

2
Flowchart Symbols
Input/Output Connector
Flow lines

Process
Pre-defined
Process

Start/End
Decision

3
Flowcharting Rules
 Symbols are connected together using different
arrows depending on the direction of flow.

 Flowchart symbols have an entry point at the top


of the symbol with no other entry points.
 The exit point for all flowchart symbols is at the
bottom of the symbol, with the exception of the
Decision symbol.

4
Flowcharting Rules..
 The Decision symbol has two exit points; these
can be on the sides or the bottom and one side.
 Generally, a flowchart will flow from top to
bottom.
 Connectors are used to connect breaks in the
flowchart. For example:
o From one page to another
o From bottom of the page to top of the same page
 Subroutines and Interrupt programs have their
own independent flowcharts.
5
Flowcharting Rules..
 All flowcharts start with a terminal or predefined
process(for interrupt programs or subroutines).

 All flowcharts end with a terminal or a


contentious loop.

6
Flowcharting Examples
 Write a flowchart to compute area of a
rectangle.
Start

Input
l, w

Area=l*w

Output
Area

End
7
Flowcharting Examples..
 Write a flowchart that determines the greater
number between two numbers entered.
Start

Input
n1,n2

Yes No
Is
n1>n2?

Output Output
n1 n2

End
8
Flowcharting Examples…
 Flowchart to print even numbers between 2 and 100
inclusive.
Start

E:=2

Output

E
E:=E+2

Is Yes
E<=100?

No
End 9
Flowchart Advantages
 Communication: It can be used as a better way
of communication of the logic of a system and
steps involved in a solution to all concerned
parties, particularly the client of the system.
 Effective Analysis: It can be used to effectively
analyze the problem.
 Documentation of program/system:
documents components of the program and its
complexity.
10
Flowchart Advantages..
 Efficient Program maintenance: once a
program is developed and becomes operational,
it needs maintenance from time to time.
Flowcharts help to understand the program and
therefore maintenance becomes easier.
 Easy Coding of the Program: writing code
resulting from a flowchart is easier than writing
without one.

11

You might also like