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

1 Tools For Developing Program Logic Flowchart and Pseudo Code Instructions

1. The document discusses tools for developing program logic such as flowcharts and pseudocode. 2. It provides definitions and examples of algorithms, pseudocode, flowcharts, and commonly used symbols in flowcharts. 3. The key advantages of using pseudocode are that it reduces complexity, increases flexibility, and ease of understanding for faster coding.

Uploaded by

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

1 Tools For Developing Program Logic Flowchart and Pseudo Code Instructions

1. The document discusses tools for developing program logic such as flowcharts and pseudocode. 2. It provides definitions and examples of algorithms, pseudocode, flowcharts, and commonly used symbols in flowcharts. 3. The key advantages of using pseudocode are that it reduces complexity, increases flexibility, and ease of understanding for faster coding.

Uploaded by

Trexie Arugay
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

TOOLS FOR DEVELOPING

PROGRAM LOGIC,
FLOWCHART AND PSEUDO
CODE INSTRUCTIONS

ENGR. TREXIE MARIE A. ARUGAY


INTRODUCTION TO ALGORITHMS

Algorithms
A step by step Often used for
Algorithm can
procedure or calculation,
A sequence of be expressed
formula for data
instruction in any
solving processing and
language
problem programming
ALGORITHMS PROCEDURES

Algorithms for making


Example:
things will often be
To build a personal
divided into sections;
computer, the parts
❖ The
or components are
parts/components/ingr
needed plus
edients or the inputs
instructions on how
which is required to
to assemble the
accomplish the task.
computer and the
❖ Action/steps/methods
result is the new
or process of data to
computer model as
produce the required
output
outcome or output
TWO FORMS OF ALGORITHMS

Pseudo Code Flowchart


is a counterfeit code,
because it’s not
really programming Type of diagram that
code since its specify represents a work flow or
only the steps process
required to
accomplish the
required task
Use special shapes as
different types of action or
steps in a process of a system
It is intended for
human reading
PSEUDO CODE
ADVANTAGE OF PSEUDO CODE

Reduced complexity of the desired system


to develop.

Increased flexibility of developing the


system

Ease of understanding for faster coding


WHY PSEUDO CODE IS NECESSARY
• The programming process is complicated and most
1 especially on your starting point

• You must first understand the program specification before


2 proceeding on coding

• You must break the main tasks that must be accomplished


into smaller ones in order to write fully developed code
3 since it is easier to understand the concept.

• Writing Pseudo code will save you time later during the
4 construction and testing phase if a program development.
DATA DICTIONARIES
Variable Name Data Type
• Data dictionaries
Num1 Integer (int)
are used to
describe the data Num2 Float (float)
used in the pseudo Sum Double (double)
code to do a Name Character (char)
process Number1 Long Integer (long int)
Number2 Long Double (long
• Standard data double)
types used in Location String (string)
pseudo code are
Proceed Boolean (boolean)
Integer, Double,
String, Char and
Boolean.
DO’S OF VARIABLE DECLARATION

Do define a variable by Do use meaningful


writing the type, then variable names.
the variable name. Example; myName,
Example; float myAge,
myScore = 100; myFavoriteColor, etc;

Do understand the number of


Do remember that other bytes each data types that
programming language is consumes in memory and what
case sensitive. values can be stored in variable
of that type.
(Score and score is
Example; float pi=3.1416, int
different); number = 100;
DON'TS OF VARIABLE DECLARATION

Don’t use any programming Don’t use unsigned


language keywords as variables for negative
variable names. numbers
Example; float qwerty Example; unsigned
= 3.1416, int char = ‘A’;
int myNumber = -12345;

Don’t use a variable name Don’t use a variable


that starts with a
name with spaces.
number.
Example; int Example; int my
1myNumber = 09876; Age = 25
PSEUDO CODE EXAMPLE
EXAMPLE 1.
Write a pseudo code that obtains two integer
numbers form user. It will print out the sum of
those two numbers
1. Start
2. Initialize all
needed variables
3. Prompt the user to enter
the first number
4. Prompt the user to enter
the second number
5. Compute the sum of those two
numbers
6. Print the result

7.End
EXAMPLE 2.
Write a pseudo code that will compute the
average of at least three numbers
1. Start

2. Initialize all
needed variables

3. Prompt the user to enter the first number


4. Prompt the user to enter the second
number
5. Prompt the user to enter the third number
6. Compute the sum of those three numbers
7. Divide the sum by 3

9. Print the result

10. End
EXAMPLE 3.
Write a pseudo code that will calculate the pay
of a worker
1. Start

2. Initialize all
needed variables
3. Input numbers of hours obtained by a
worker

4. Input rate of a worker

5. (Pay = hours * rate)

6. Print the result

7. End
FLOWCHART
COMMONLY USED SYMBOLS AND
FUNCTIONS

Start Start/End Symbol


• The terminator symbol marks the starting or ending point
of the system. It usually contains the word “Start” or
End “End”

Action/Process Symbol
• A box can represent a single step (“add two cups of
Process flour”), or an entire sub-process (“make a bread”) within
a larger process

Document Document Symbol


• A printed document or result
COMMONLY USED SYMBOLS AND
FUNCTIONS

Decision Symbol
• A decision or branching point lines representing different
Decision decisions emerge from different points of the diamond

Input/Output Symbol
Input • Represents material or information entering or leaving the
system, such as customer order (input) or product
(output).
Output

Preparation Symbol
• Represents a set-up to another step in the
Preparation process
• Initializing all needed variables
COMMONLY USED SYMBOLS AND
FUNCTIONS

Connector Symbol
• Indicates that the flows continues where a matching
symbol (containing same letter) has been placed.

Arrow Symbol
• A line is a connector that shows relationships between the
representative shapes.

Off-Page Connector Symbol


Off-page connector • Used to connect remoted flowchart portions on
different pages. One flowline enters or exits.
INTERPRETING YOUR FLOWCHART
Determine who is involved in the process.
1
Form theories about root causes.
2
Identify ways to simplify and refine the action taken.
3
Determine how to implement changes on the process taken.
4
Locate cost-added-only steps for faster checking.
5
Provide training for further knowledge.
6
TYPES OF FLOWCHART
BASIC FLOWCHART

Basic flowchart identify


the major steps in a
process in a simple and
easy-to-understand
way. They are use to
familiarize a person or
group with the major
steps of a process by
giving them a broad
overview
DEPLOYMENT FLOWCHART

Deployment flowcharts
indicate the people
involved in each step as
well. This type of
flowchart is useful
when a certain process
involves different
departments or areas.
OPPORTUNITY FLOWCHART

In opportunity
flowcharts, it may not
be a simple moving
from this step to the
next or answering a
single question at each
page. For example, the
left side may show the
steps taken when
everything goes right
and right side has the
steps taken when things
go wrong.
PROCESS FLOWCHART
Relatively it is a basic
overview, process
flowchart gives full
listing of the major
steps as well as the sub-
steps in process. For
example, a process
flowchart for the
troubleshooting of a
machine might ask
questions for the person
or group to answer
before going to the next
stage.
FLOWCHART EXAMPLES
EXAMPLE 1.

Draw a flowchart
that obtains two
integer numbers
form user. It will
print out the
sum of those two
numbers
EXAMPLE 2.

Draw a flowchart
that will
compute the
average of at
least three
numbers
EXAMPLE 3.

Draw a flowchart
that will
calculate the pay
of a worker

You might also like