0% found this document useful (0 votes)
10 views4 pages

Pseudocode and Flow Chart Lecture 1 (1)

Uploaded by

janreynar.pahang
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)
10 views4 pages

Pseudocode and Flow Chart Lecture 1 (1)

Uploaded by

janreynar.pahang
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/ 4

Programming Algorithm Defined

A programming algorithm is a procedure or formula used for solving a problem. It is based


on conducting a sequence of specified actions in which these actions describe how to do
something, and your computer will do it exactly that way every time. An algorithm works by
following a procedure, made up of inputs. Once it has followed all the inputs, it will see a
result, also known as output.

Characteristics of an algorithm:

1. Precision – the steps are precisely stated.

2. Uniqueness – results of each step are uniquely defined and only depend on the
input and the result of the preceding steps.

3. Finiteness – the algorithm stops after a finite number of instructions are executed.

4. Input – the algorithm receives input.

5. Output – the algorithm produces output.

6. Generality – the algorithm applies to a set of inputs.

A Pseudocode is defined as a step-by-step description of an algorithm. Pseudocode does


not use any programming language in its representation instead it uses the simple English
language text as it is intended for human understanding rather than machine reading.
Pseudocode is the intermediate state between an idea and its implementation(code) in
a high-level language.

Pseudo code is a term which is often used in programming and algorithm based fields. It is
a methodology that allows the programmer to represent the implementation of an algorithm.
Simply, we can say that it’s the cooked up representation of an algorithm. Often at times,
algorithms are represented with the help of pseudo codes as they can be interpreted by
programmers no matter what their programming background or knowledge is. Pseudo code,
as the name suggests, is a false code or a representation of code which can be understood
by even a layman with some school level programming knowledge. Algorithm: It’s an
organized logical sequence of the actions or the approach towards a particular problem. A
programmer implements an algorithm to solve a problem. Algorithms are expressed using
natural verbal but somewhat technical annotations. Pseudo code: It’s simply an
implementation of an algorithm in the form of annotations and informative text written in
plain English. It has no syntax like any of the programming language and thus can’t be
compiled or interpreted by the computer.
What is the need for Pseudocode

Pseudocode is an important part of designing an algorithm, it helps the programmer in


planning the solution to the problem as well as the reader in understanding the approach
to the problem. Pseudocode is an intermediate state between algorithm and program that
plays supports the transition of the algorithm into the program.

How to write Pseudocode?

Before writing the pseudocode of any algorithm the following points must be kept in mind.

• Organize the sequence of tasks and write the pseudocode accordingly.

• At first, establishes the main goal or the aim.

Example:
This program will allow the user to check
the number whether it's even or odd.

• Use standard programming structures such as if-else, for, while, and cases the
way we use them in programming. Indent the statements if-else, for, while loops as
they are indented in a program, it helps to comprehend the decision control and
execution mechanism. It also improves readability to a great extent. Example:

IF “1”
print response
“I AM CASE 1”

IF “2”
print response
“I AM CASE 2”

• Use appropriate naming conventions. The human tendency follows the approach of
following what we see. If a programmer goes through a pseudo code, his approach
will be the same as per that, so the naming must be simple and distinct.
• Reserved commands or keywords must be represented in capital
letters. Example: if you are writing IF…ELSE statements then make sure IF and ELSE
be in capital letters.

• Check whether all the sections of a pseudo code are complete, finite, and clear to
understand and comprehend. Also, explain everything that is going to happen in the
actual code.

• Don’t write the pseudocode in a programming language. It is necessary that the


pseudocode is simple and easy to understand even for a layman or client,
minimizing the use of technical terms.

Difference between Algorithm and Pseudocode


Algorithm Pseudocode

A Pseudocode is a step-by-step
An Algorithm is used to provide a
description of an algorithm in code-
solution to a particular problem in form
like structure using plain English
of a well-defined step-based form.
text.

An algorithm only uses simple English Pseudocode also uses reserved


words keywords like if-else, for, while, etc.

These are fake codes as the word


These are a sequence of steps of a
pseudo means fake, using code like
solution to a problem
structure and plain English text

There are no rules to writing There are certain rules for writing
algorithms pseudocode

Algorithms can be considered Pseudocode cannot be considered an


pseudocode algorithm

It is difficult to understand and


It is easy to understand and interpret
interpret
Difference between Flowchart and Pseudocode

Flowchart Pseudocode

A Pseudocode is a step-by-step
A Flowchart is pictorial representation of
description of an algorithm in code like
flow of an algorithm.
structure using plain English text.

A Flowchart uses standard symbols for


input, output decisions and start stop Pseudocode uses reserved keywords
statements. Only uses different shapes like like if-else, for, while, etc.
box, circle and arrow.

This is a way of visually representing data, These are fake codes as the word
these are nothing but the graphical pseudo means fake, using code like
representation of the algorithm for a better structure but plain English text instead
understanding of the code of programming language

Pseudocode is better suited for the


Flowcharts are good for documentation
purpose of understanding

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy