0% found this document useful (0 votes)
0 views6 pages

CMP011 Flowchart PseudoCode

The document explains flowcharts as graphical representations of algorithms, detailing their structure, symbols, and guidelines for effective use. It also introduces pseudocode as an informal method for expressing program design, highlighting its advantages and limitations compared to flowcharts. Key components of both flowcharts and pseudocode are outlined, including symbols for processes, decisions, and iterations.

Uploaded by

balo-aisha
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)
0 views6 pages

CMP011 Flowchart PseudoCode

The document explains flowcharts as graphical representations of algorithms, detailing their structure, symbols, and guidelines for effective use. It also introduces pseudocode as an informal method for expressing program design, highlighting its advantages and limitations compared to flowcharts. Key components of both flowcharts and pseudocode are outlined, including symbols for processes, decisions, and iterations.

Uploaded by

balo-aisha
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
You are on page 1/ 6

CMP 011

Flowchart

Flowchart can be defined as a graphical representation of an algorithm. The pictorial

representation of algorithm is called FLOWCHART. Flowchart is a picture, which shows

the sequence in which data are read, computing is performed, decision is made and results are

obtained.

The first formal Flowchart is attributed to John Von Neumann in 1945. The flowcharts are

read from left to right and top to bottom. Program flowcharts show the sequence of

instruction in a program or a subroutine. The symbol used in constructing a flowchart are

simple and easy to learn. Flowchart symbols have been standardized by the American

National Standards Institute (ANSI).

Some of these rules and guideline are as follows:

1. First chart main line of logic, then corporate detail.

2. Maintain a constant level of detail for a given flowchart.

3. Do not chart every detail on the flowchart. Only a graphic representation step of the

program. A reader who is interested in greater detail can refer to the program itself.

4. Words in the flowchart symbols should be common statements and easy to

understand. It is recommended to use descriptive titles in designer’s own language

rather than machine oriented languages.

5. Be consistent in using names and variables in the flowchart.

6. from left to right and top to bottom in the constructing flowcharts

7. keep the flowchart as simple as possible. The crossing of flowlines should be avoided

as far as practicable.

1
8. If a new flowcharting page is needed, it is recommended that the flowchart be broken

at the input or output point. Properly labelled connectors should be used to link the

portions of the flowchart on different pages.

The symbols used are

Flowchart Symbols

1. Terminal

This symbol is used to denote the beginning and the end of a flowchart; it is annotated

with the verbs START, BEGIN, STOP and END as appropriate.

2. Flow line

This symbol shows the flow of work in a process, normal flow is from top to bottom and

left to right.

3. Process Symbol

This symbol is used to define the execution of an operation i.e. addition, average, subtraction,

etc.

4. Input/ Output

This symbol represent input of data for processing and output of information i.e. Read and

write statement.

5. Connector Symbol

This is used to represent a junction at which the flowchart comes from or where the flow

continues i.e. entry to or exit from part of program flowchart.

6. Decision Symbol

2
This symbol is used to express any condition that might provide alternate paths of flow

through the program. If the condition is based on YES or NO possibility, two exit lines show

the possible paths that the program may take.

7. Predefined process

This is widely used in diverse programs when a subroutine or a series of steps for a particular

purpose, which is repeated several times throughout the program.

Example 1: Draw a flowchart to compute area and circumference of circle

start

Let pie = 3.142

Input radius

Area = pie * radius * radius


Circumference = 2 * pie * radius

Print Area

Print
Circumference

stop

3
Example 2: Draw a flowchart to calculate the average of the twenty numbers

start

Initialize count and


sum to zero

Input first
number

Count = count + 1
Sum = first number + sum

Input next
number

Count = count + 1
Sum = next number + sum

Is count
<= 20
No
?

Yes

Average = sum/20

Print average

stop

4
Pseudo code

Pseudo-code is an informal way to express the design of a computer program. Pseudo code is

another programming analysis tool that is used for planning program logic. “Pseudo” means

imitation or false and “Code” refers to the instructions written in a programming language.

Pseudo code, therefore is an imitation of actual computer instructions.

These pseudo-instructions are phrases written in ordinary natural language (e.g English,

French, German, etc.). Instead of using symbols to describe the logic steps of a program, as in

flowchart. Pseudo code uses a structure that resembles computer instructions. Because it

emphasizes the design of the program, pseudo code is also called Program Design

Language (PDL).

Pseudo code is made up of the following basic logic structures that have been proved to be

sufficient for writing any computer program:

1. Sequence

2. Selection (If … then … else of If… then)

3. Iteration (Do … while or repeat … until)

Sequence logic is used for performing instructions one after another in sequence. Thus, for

sequence logic pseudocode instructions are written in the order, or sequence, in which they

are to be performed. The logic flow of pseudocode is from top to bottom. \sequence logic,

also called DECISION LOGIC is used for making decisions. It is used for making

decisions. It is used for selecting the proper path out of the two or more alternative paths in

the program logic.

Selection logic is depicted as either an IF … Then or an IF … Then …. Else structure.

5
Iteration logic is used to produce loops. When one or more instructions may be executed

several times depending on some condition. It uses two structures called the DO… WHILE

and the REPEAT … UNTIL.

ADVANTAGES

1. Converting a pseudocode to a programming language is much more easier as

compared to converting a flowchart or a decision table

2. As compared to a flowchart it is easier to modify the pseudocode of a program logic

when program modifications are necessary.

3. Writing of pseudocode must involves less time and effort than drawing an equivalent

flowchart. Pseudocode is easier to write than an actual programming language

because it has only a few rules to follow allowing the programmer to concentrate on

the logic of the program.

LIMITATION

1. In case of pseudocode, a graphic representation of program logic is not available.

2. There are standard rules to follow in using pseudocode.

3. For a beginner, it is more difficult to follow the logic of or write pseudocode as

compared to flowcharting.

You might also like