0% found this document useful (0 votes)
3 views

Module 4 Design a Flowchart of a Simple Program

This module provides an overview of flowcharts, their importance in programming, and guidelines for their use. It explains the difference between system flowcharts and program flowcharts, and outlines the advantages and disadvantages of using flowcharts in programming. Additionally, it includes examples and references for further learning about flowcharting and programming concepts.

Uploaded by

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

Module 4 Design a Flowchart of a Simple Program

This module provides an overview of flowcharts, their importance in programming, and guidelines for their use. It explains the difference between system flowcharts and program flowcharts, and outlines the advantages and disadvantages of using flowcharts in programming. Additionally, it includes examples and references for further learning about flowcharting and programming concepts.

Uploaded by

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

10

Computer
Programming
Quarter II – Module 4:
Design a Flowchart

"Designed by macrovector / Freepik"


At the end of this module you will also find:
References This is a list of all sources used in
developing this module.
The following are some reminders in using this module:

1. Use the module with care. Do not put unnecessary mark/s on any part of
the module. Use a separate sheet of paper in answering the
exercises.
2. Read the instruction carefully before doing each task.
3. Observe honesty and integrity in doing the tasks and checking your
answers.
4. Finish the task at hand before proceeding to the next.
5. Return this module to your teacher/facilitator once you are through with it.
If you encounter any difficulty in answering the tasks in this module, do not
hesitate to consult your teacher or facilitator. Always bear in mind that you
are not alone.

We hope that through this material, you will experience meaningful learning
and gain deep understanding of the relevant competencies. You can do it!

ii
Explore

Introduction:
Computers are not intelligent. Yes, computers are fast. They are able to
calculate complex computations in mere seconds. However, being fast does not
make computers intelligent. It only makes them high-speed followers, nothing
more. In reality, computers are only as food as the instructions or programs you
feed them. This is very important point to consider in programming.

Programming is the art and science of creating programs. A program is a


list of organized instructions that the computer must follow in order to follow in
order to process data into information. The instructions consist of statements
written in a programming language such as C, Visual Basic, and Java.

You might think that programming simply involves typing words and numbers in
a computer. Actually, this activity, called coding, is only a small part of the
whole programming process. Programming, also called software engineering, is a
multi-step process for creating a program.

Programming is also method of solving a problem. Programming uses


algorithm – an algorithm being a set of ordered steps for solving a problem, and
essentially a synonyms of logic. Analytical and critical thinking is needed in the
formulation of solution to a problem.

1.
Learn

What is a Flowcharts?
A flowchart is a visual outline of an algorithm in which the steps and processes to
be followed are represented by symbols. There are actually two kinds of
flowcharts: the system flowcharts and the program flowchart.

A system flowchart is a diagrammatic representation of the broad flow of work,


documents and operations. The hierarchy chart for the payroll process in Figure
1.1 is an example of a system flowchart. A system flowchart shows what job is to
be done. Thus, a system flowchart merely names the processes to be performed
in the “predefined process”.

A program flowchart, on the other hand, is a diagrammatic representation of a


solution to a given problem for which the program is written. A program
flowchart shows how the job is to be done. Thus, a program flowchart outlines
the details of the sequence of operations to be executed.

Problem:
Get the following data from the user: employee’s name,
hourly rate, number of hours worked, and deductions
Calculate the employee’s gross pay and net pay
Display the employee’s name, gross pay, and net pay

Pseudocode:
READ name, hourly rate, hours worked, deductions
Calculate: Gross pay = hourly rate multiplied by number
of hours worked
Calculate: Net pay = Gross pay minus deductions
WRITE name, Gross pay, Net pay

Figure 1.1 A payroll program algorithm with its pseudocode

The algorithm and pseudocode in Figure 1.1 would look liked one below as a
flowchart:
Start

Input
Name, HrlyRate,
HrsWork, Deductn

GrossPay = HrlyRate * HrsWork

NetPay = GrossPay - Deductn

Print
Name, GrossPay,
Netpay

End

Figure 1.2 A program flowchart for the problem in Fig. 1.2

History of Flowcharts
The first structured method for documenting process flow, the "flow process
chart", was introduced by Frank and Lillian Gilbreth in the presentation "Process
Charts: First Steps in Finding the One Best Way to do Work", to members of the
American Society of Mechanical Engineers (ASME) in 1921. The Gilbreths' tools
quickly found their way into industrial engineering curricula. In the early 1930s,
an industrial engineer, Allan H. Mogensen began to train business people in the
use of some of the tools of industrial engineering at his Work Simplification
Conferences in Lake Placid, New York.
Art Spinanger, a 1944 graduate of Mogensen's class, took the tools back to
Procter and Gamble where he developed their Deliberate Methods Change
Program. Ben S. Graham, another 1944 graduate, Director of Formcraft
Engineering at Standard Register Industrial, applied the flow process chart to
information processing with his development of the multi-flow process chart, to
present multiple documents and their relationships. In 1947, ASME adopted a
symbol set derived from Gilbreth's original work as the "ASME Standard:
Operation and Flow Process Charts."
Douglas Hartree in 1949 explained that Herman Goldstine and John von
Neumann had developed a flowchart (originally, diagram) to plan computer
programs. His contemporary account was endorsed by IBM engineers and by
Goldstine's personal recollections. The original programming flowcharts of
Goldstine and von Neumann can be found in their unpublished report, "Planning
and coding of problems for an electronic computing instrument, Part II, Volume
1" (1947), which is reproduced in von Neumann's collected works.
The flowchart became a popular tool for describing computer algorithms, but its
popularity decreased in the 1970s, when interactive computer terminals and
third-generation programming languages became common tools for computer
programming, since algorithms can be expressed more concisely as source code
in such languages. Often pseudo-code is used, which uses the common idioms of
such languages without strictly adhering to the details of a particular one.
Nowadays flowcharts are still used for describing computer algorithms. Modern
techniques such as UML activity diagram and Drakon-charts can be considered to
be extensions of the flowchart.

Table 1.1 ANSI Standard Flowchart Symbols


Symbol Name Description
1. Terminal Marks the beginning (START) and the
end (END, STOP) of the program
2. Input/Output Contains any statement that causes
(I/O) data to be inputted to a program
(INPUT, READ) or outputted from the
program (PRINT, WRITE), such as
printing on the display screen or printer
3. Process Contains an operation that shows tasks,
such as a calculation or an assignment
of a value to a variable
4. Decision Contains a question or condition that
requires a yes/no or true/false response
and leads to one of the two or have
alternative course of action
5. On-page Connects 2 flowchart segments that are
Connector found on the same page to eliminate
lengthy flow lines. This symbol should
be labeled (e.g. capital letters) to show
parts that are being connected
6. Off-page Connects 2 flowchart segments that are
connector found on different pages, this is used
when a flowchart requires more than on
page
7. Flowlines and Connect symbols and indicate sequence
Arrowheads of operations (Standard direction flow is
from top to bottom and from left to
right).
General Rules for flowcharting
1. All boxes of the flowchart are connected with Arrows. (Not lines)
2. Flowchart symbols have an entry point on the top of the symbol with no other
entry points. The exit point for all flowchart symbols is on the bottom except
for the Decision symbol.
3. The Decision symbol has two exit points; these can be on the sides or the
bottom and one side.
4. Generally a flowchart will flow from top to bottom. However, an upward flow
can be shown as long as it does not exceed 3 symbols.
5. Connectors are used to connect breaks in the flowchart. Examples are:
 From one page to another page.
 From the bottom of the page to the top of the same page.
 An upward flow of more than 3 symbols
6. All flow charts start with a Terminal symbol.
7. All flowcharts end with a terminal.

Advantages of Flowchart:
 Flowcharts are better way of communicating the logic of system.
 Flowcharts act as a guide for blueprint during program designed.
 Flowcharts helps in debugging process.
 With the help of flowcharts programs can be easily analyzed.
 It provides better documentation.
 Flowcharts serve as a good proper documentation.

Disadvantages of Flowchart:
 It is difficult to draw flowchart for large and complex programs.
 In this their is no standard to determine the amount of detail.
 Difficult to reproduce the flowcharts.
 It is very difficult to modify the Flowchart.
Example of flowchart and coding in different
programming languages:

Figure 1.3 A flowchart to


input two numbers from user
and display the largest of two
numbers

Flowchart Example – 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.
Figure 1.9 Flowchart of Medical Service

Flowchart Example – Calculate Profit and Loss


The flowchart example below shows how profit and loss can be calculated.

Figure 1.10 Profit and loss calculation flowchart


References

1. https://en.wikipedia.org/wiki/Flowchart#History
2. https://www.visual-paradigm.com/tutorials/flowchart-tutorial/
3. Marinar F. Castro, A. R. (n.d.). understanding Structured Programming
(Second Edition ed.). Quezon City, Philippines: Vibal Publishing, Inc.
4. https://faradars.org/wp-content/uploads/2015/07/Algorithm-and-Flow-
Chart.pdf

For inquiries or feedback, please write or call:

Department of Education – Regional Office VIII – Curriculum and Learning


Management Division (CLMD) - Learning Resources Management Section (LRMS)

Government Center, Candahug, Palo, Leyte, 6501

Telefax: (053) 323-3156; 323-3854; 824-4627

Email Address: *[email protected]


*[email protected] *[email protected]

You might also like