Computer Programming1 HBLK 1
Computer Programming1 HBLK 1
Gacita 1
Learning Objectives
flowchart.
FLOWCHART
“Use of symbols and phrases to designated the logic of how a problem is solved”
“A common method for defining the logical steps of flow within a program by using
a series of symbols to ident if the basic input, Process and Output (IPO’s function
within a program”
“A two-dimensional representation of an algorithm; the predefined graphic
symbols of flowchart are used to indicate the various operations and the flow of
control”
“A diagram representing the logical sequence in which a combination of steps or
operations is to be performed. It is a blueprint of the program”
ALGORITHM
TERMINAL
DECISION
While the variations and versions of flowcharts are endless, there are four
flowchart types that are particularly popular and very versatile. These four common
flowcharts are great for describing business, manufacturing, or administrative processes,
how an organization functions, or how different departments work together.
A process flowchart or process flow diagram is probably the most versatile of the four
commonly used flowchart types because it can be applied to virtually anything. Process
flowcharts or process mapping can help quickly explain how something gets done in your
organization. Sometimes, these types of flowcharts use a standard language or notation,
like Business Process Modeling and Notation. Use a process flow diagram to:
A workflow chart shows the way a business or process functions. The below example
illustrates the steps required for a potential customer to renew a policy through a
company website. This type of workflow diagram can be used to:
The swimlane flowchart comes in handy when you need to show multiple flows of
information side by side. Swimlane diagrams might sound really similar to a workflow
diagram, but the key here is that it allows you to create different categories where
activity takes place.
More complicated diagrams could include five, six, or even more swimlanes, like
for each department within an organization or each role on a cross-functional team. The
goal of swimlanes is to clarify and simplify a flowchart, though, so avoid adding too
many lanes and keep things simple!
A data flowchart or data flow diagram shows the way data is processed. It comes
in handy when you want to design or analyze a system. Although most often used for
software development and design, it can be used to analyze any type of information
flow, like how information moves through a business. The below example shows a
typical sales funnel. In this case the “data” is consumer behavior.
All of the four most common flowchart types listed above — and other variations
of flowcharts — do one thing really well: they visually capture a step-by-step process. In
any field, flow diagrams or flowcharts document a process and give their users the
ability to analyze or optimize that process. They also make it easier for new employees
or users to understand the process as they learn. All this means that having clear
documentation is a key way to increase team productivity.
Flowcharts in Manufacturing
Flowcharts are extremely valuable in manufacturing, where standardization and
uniformity are important. In manufacturing, they're used to:
Show the ingredients, chemicals, or other inputs that go into the creation of a
product
Clearly illustrate the manufacturing process to show dependencies and bottlenecks
Create a consistent quality assurance or evaluation process
It identifies steps that do not add value to the internal or external customer,
including delays; needless storage and transportation; unnecessary work,
duplication, and added expense; breakdowns in communication.
It helps team members gain a shared understanding of the process and use this
knowledge to collect data, identify problems, focus discussions, and identify
resources.
START ALGORITHM
Step 1: Read in the value of N.
Step 2: Print the value of N.
READ N
PRINT N
END
EXAMPLE 2.
Draw a flowchart that will compute and display the sum and product of
two numbers. Write its equivalent algorithm.
ALGORITHM
Sum=5
Product=5
READ A, B
EXAMPLE 3.
MEDICAL SERVICE
This is a hospital flowchart example that shows how clinical cases shall be
processed. This flowchart uses decision shapes intensively in representing alternative
flows.
SIMPLE ALGORITHMS
A flowchart can also be used in visualizing algorithms, regardless of its
complexity. Here is an example that shows how flowchart can be used in showing a
simple summation process.
A
T
ARITHMETIC OPERATORS
OPERATORS MEANING
+ Addition
- Subtraction
* Multiplication
/ Division
RELATIONAL OPERATORS
OPERATORS MEANING
= Equal
> Greater than
< Less than
<> Not Equal
LOGICAL OPERATORS
OPERATORS MEANING
&& AND
|| OR
! NOT
EXAMPLE 3.
Draw a flowchart that will input values for A and B. Compare two values inputted
and print which of the values is higher including the remark “Higher”. Write its
equivalent algorithm.
START
INPUT A, B
Print A,
A>B
“Higher”
Print B, END
“Higher”
ACTIVITY 3.
Draw a flowchart that will input grade of student and determine whether the grade
is passed or failed. Print the name, grade and remarks of student. Write its equivalent
algorithm.
ALGORITHM:
STEP 1: Initialize name and remarks into blanks.
STEP 2: Read in values for Grade and Name.
STEP 3: Test if Grade is greater than or equal to 60.
STEP 4: If Grade is greater than or equal to 60, remark is “Passed”. However, if Grade is
below 60, remark is “Failed”.
STEP 5: Print the name, grade, and remarks.
ALGORITHM: