You are on page 1of 13

Chapter 2 – Problem Solving Through Flowcharts 1

"Creativity is the process of having original ideas that have value. It is a process; it's not
random."

-Ken Robinson.

Have you encountered challenges before? How did you solve it? Were you successful in
overcoming those challenges? If not, do you attribute your failure in your lack of planning and
visualization of the situation? Those questions are our focus for these two consecutive modules
about Problem Solving through Flowcharts.

In this first of the two-part modules, you will learn about the art of problem solving, particularly
in Computer Programming. To aid you with the conceptualization of your soon-to-be
instructions that you will command the computer to do, you will create a visual aid called
flowcharts. In addition to that, you will be exposed to the Research-standard syntax called
Pseudocodes.

At the end of this module, you will be able to:


1. Identify the characteristics of problem solving in computer programming
2. Identify and describe the symbols in flowcharting
3. Identify the conventions in pseudocodes
4. Organize a day-to-day process using flowcharts and pseudocodes
5. Deduce the benefits and shortcomings of flowcharts and pseudocodes

Again, researching beyond the coverage of this module is highly encouraged to supplement
your understanding of the topics covered. And as always, think and see beyond the box.

So, what are we waiting for? Let us continue our exploration of the world of Computer
Programming.

Recall

In the previous module, we talked about the field of Computing and Programming in general.
We also enumerated the domains under Computer Development, namely:
a. Web Development
b. Back-end Development
c. Mobile Development
d. Data Science
e. Application Development
f. API Development, and
g. Embedded Systems Development
Lastly, we went through an overview of the infamous programming languages as of 2016:
a. JavaScript
b. Java
c. Phyton
d. Ruby
e. PHP
f. C++
g. C#
h. Go
i. Shell
j. Objective – C

Introduction

Problem Solving is defined as the systematic approach in searching for a solution or set of
solutions to a specific problem. This approach can be in any form such as by listing the possible
options and choosing the most efficient of them, providing weights to all possible scenarios and
choosing the most significant scenario, or applying small-scale to massive calculations to
incorporate values to challenges and optimally solve those smaller challenges to complete the
main problem. With addition of several other characteristics, in the context of Computer
Science, this can be called algorithms.
In this module, we will be taking the concept of Problem Solving in the context of Computer
Programming; how to come up with the right solution to a given problem.

Problem Solving in Computer Programming

Problem Solving is the most essential skill that anyone venturing the field of Computer
Programming needs. It basically says whether a specific challenge is worth solving given a finite
time. However, what makes problem solving in Computer Programming different from the
conventional problem solving are the characteristic that a solution to the problem should have
met. Problem Solving in Computer Programming should satisfy the following characteristics:
1. Solvable
2. Goal-oriented
3. Verifiable
4. Quantifiable
5. Doable in finite steps
6. Doable in current technological limitations
Problem solving in Computer Programming requires the problem to be solvable. This
characteristic might seem to be an obvious requirement, but is tend to be overlooked in several
ways. A famous quote from a 2009 American comedy-drama film "Up in the Air" says "It's only
a problem, if it has a solution." This presents one aspect of solvable that focuses on the
problem - there should exist at least one probable solution. It is unthinkable to process
problems that pose no direct solutions. It is like playing NBA-sized basketball with tigers. That
situation is designed for humans-only convention, whereas the subjects involved cannot in
anyway be altered to satisfy the need of the situation in this very moment.

Problem solving also requires the problem to be goal-oriented. A goal focuses the solutions to
meet a specific one-path ending. Setting a goal to the problem-at-hand lets you identify several
approaches and solutions. It also set a few limitations to which possible solutions are subjected
to determine accept-reject criteria.

Problem solving also requires the problem to be verifiable. It is impractical to provide


solutions for problems where you cannot even verify the validity of your solutions. In
addition, there is also the need to certify that there exist many other criteria to make the
solution fail and succeed. For example, we can have a slot machine that accepts only 5-peso
and 1-peso coins be subjected to tests wherein you can attempt to insert 10-peso, 5-peso, 1-
peso and 5-cent coins into the slot machine. The slot machine should then reject the 10-
peso and 5-cent coins in some defined way but accept the 5-peso and 1-peso coins.
Problem solving also requires the problem to be quantifiable. It is unworkable in Computer
Programming if the problem cannot be quantified in any scale possible. For instance, we
have a problem which is about determining the acceptance rating of a proposed Thesis title.
This problem can be solved through Computer Programming provided a qualifying criterion
is provided. However, if tasked to provide solution for a problem to classify which of the
given inputs is fake and which is real.
Problem solving also requires the solution to be doable in a finite number of steps. We live
in a world of limited resources. One of those resources concerned in Computer
Programming is time. It is highly impractical to provide a solution that takes a million of
hours to complete. In addition to time, computers have a limited amount of allocated
resources, namely: RAM, storage and processing power. Maxing out these resources just for
a solution is not only impractical but also useless.
Lastly, problem solving also requires the problem and solution to be doable within the limits
of the current technology. In computer programming, we simply reuse the resources
currently at hand. Relying on other resources that either does not yet exist or is impossible
to get our hands on is proven to be unintelligible. We do not concern ourselves with what
will probably be available in the future since Computer Programming aims for practicality
over theory. We have Computer Science for those regards.
Flowcharts Essentials

Now that we have a set of characteristics which we can use to determine the viability of
problems and possible solutions in terms of Computer Programming, we now should be able
to present our solution in a visual format called flowchart. Flowchart is a visual aid showing
a sequence of actions or operations involved in Computer Programming. Flowchart helps
computer programmers in visualizing their thought solution which helps them visually relay
their low-level solution and helps to identify key aspects of the solution which can pose
problems given a specific combination of inputs and outputs. Figure 1 shows a sample of a
flowchart which illustrates the process of going to school using one of the two
transportation systems available, the bus and the subway.

The flowchart in Figure 1 shows almost all the fundamental elements used in flowcharting. That
flowchart solves the problem of going to school by choosing an appropriate transportation
system based on time.
Let us go through the process in the flowchart. The flowchart starts with the student leaving
home. After leaving, the student needs to choose the best transportation system he will take to
arrive at his school.

Based on the given flowchart, we can assume that there is a heavy buildup of traffic past 7
AM. It is therefore a better choice to take the subway if the time is past 7 AM.
The student then needs to check the time whether it is already past 7 AM. If not, he can still
choose bus as his transportation vehicle. If it is already past 7 AM, he needs to take the subway
to arrive at school on time. After taking the best transportation system, the flowcharts end with
the student arriving at school on time.

You might have noticed that the flowchart uses two distinct symbols for checking the time and
deciding what action to do. This is essential in Computer Programming. You need to learn how
to identify distinct actions. The act of checking the time is totally different from deciding which
action to do. Although it is tempting to simply combine the two actions, the computer will still
read them as two distinct actions. Hence as a promising computer programmer, you need to be
able to personally identify such easily missed distinctions and act accordingly as how the
computer will interpret those instructions. Knowing this will not only make your codes easy to
read, but also optimize your codes.

Symbols used in Flowcharts


Flowcharts use a defined set of symbols to represent a specific action performed. Those
symbols are used like how you will use Lego bricks to build something. In Computer
Programming, those symbols are combined in a specific manner to build an application, for
example. One thing to note for the symbols is like a set of Lego bricks, symbols should be
used in a manner that fits the requirements of the solution to create a logical flow of actions
(i.e. instructions for the computer).
The symbols in Table 1 are connected by a line with one and only one arrow head, usually
called arrow. In Mathematics, this is a ray with no suggestive prominent endpoint. The arrow
head determines the flow of the process, where next symbol to read is.

Figure 2 shows the progression of symbols using the arrow. In the figure, Process 2 is executed
first before Process 1 despite their naming. The arrow is the sole indicator of the progress.
Figure 3 shows a more complex progression using arrows. In this figure. Process 1 is executed
first, followed by Process 2, then Process 3. In Process 3, the arrow points to Process 4 which is
pointed back to Process 1. This specific example is a non-terminating process which should be
avoided in actual programming design.

Standards in Flowcharting

Now that you know the different symbols used in creating your flowcharts, you need to adhere
to the standards used in writing flowcharts. In this section, you will learn the different
standards in flowcharts which should aid you also in writing your codes in the future. These
standards were set not to limit you with the usage of the symbols, but to give you freedom in
setting your logic for writing computer instructions through computer programming.
Flowcharts should always have two (2) and only two terminator symbols, namely the Start
terminator and the End terminator. The Start terminator always starts the entire flowchart
sequence. It should always be the first symbol found at the top-most of all flowcharts. If the
flowchart sequence is multi-paged, the Start terminator is found at the first page. The End
terminator always ends the entire flowchart sequence. It should always be the last symbol
found at the bottom-most of all flowcharts. If the flowchart is multi-paged, the End terminator
is found at the last page.

Decision symbols always have two (2) possible scenarios, the YES and NO.

Since the Decision symbol contains a specific condition, that condition should always be
answerable by YES or a NO. If the condition is not answerable by a YES or a NO, the condition
should be rephrased to adhere to standard regardless of the number of nested Decision
symbols to be made. This is the case for the Decision symbol since the computer can only
process one condition at a time. For example, if you asked "which color did the user pick?", the
computer will process that with a series of question like "Is it Blue?", "Is it Red?", and so on. The
computer will not directly check for the answer like "The user definitely chose Red" without
checking for the rest of the possible answers.

Flowchart symbols should always have one (1) and only one out-going arrow. Since the arrow
signifies that there is a progression of flow, it is a requirement that symbols should only have
one arrow to other symbols. We are limiting our thinking to single-threaded flow. Hence, a
symbol can only be succeeded by only one symbol. The exceptions to this are the End
terminator and the Decision symbol. The End terminator marks the end of the flowchart;
therefore, there is no logical need for it to have an arrow. The Decision symbol has two possible
scenarios; therefore, there are always two [2) and only two arrows.

Flowchart symbols can have any number of in-going arrows. Since most symbols can start from
any of the other symbols, it is logically accurate to allow any number of in-going arrows.
However, there is only one [1] symbol that does not allow any in-going arrow - the Start
terminator. The Start terminator marks the start of the entire flowchart; therefore, there is no
logical reasoning to connect other symbols to the Start terminator. Should there be a need to
restart the entire flow, the symbol should connect to the symbol with an in-going arrow from
the Start terminator.

Flowcharts are written from top to bottom. With the Start terminator at the top, the next
symbols should be placed below the Start terminator, and the next below the previous symbol.
There exist some symbols beside a symbol, which is the case for the Decision, On-page
Connector and Off-page Connector symbols.

Flowcharts should not have any out-going arrow pointed upwards. This is for creating a
seamless flow process. For complex flowcharts supporting upward out-going arrows,
determining the connection between the symbols will prove to be difficult. Hence, there is the
need for this standard. Should there be a need to connect to other symbols found at the top of
the sequence, you can use On-page and Off-page Connector symbols.
Lastly, flowcharts should not have any overlapping arrows. This is for emphasizing clarity.
Having overlapping arrows creates ambiguity in the direction of the arrows intersecting and
their respective symbols.

Pseudocodes

Pseudocodes are not Academe-standard for expectant undergraduate students. However,


there is a growing demand in the usage of pseudocodes not only in the Academic sector, but
also the Research sector .Pseudocodes are high-level description of the processes in Computer
Programming. Their format varies by writer. Some are English-like to accommodate non-
technical audience. Some are written close to the actual syntax used in the source code to
accommodate technical audiences and Research critics.

Course Convention

Pseudocode are generally user-centric and no defined standard for writing them. However, for
the ease of the codes to be written in the future modules and for the ease of understanding for
your peers, we will set a convention in writing pseudocodes. This should enable us, together
with your peers and mentors, to talk using only one language.
For you to understand pseudocodes better, let us use the sample flowchart at Figure 1.
Remember that in the sample flowchart, the problem being solved is how to reach school in the
most efficient and travel-wise method. Following the flowchart, we will have the following as its
pseudocode equivalent.

Glossary

Algorithm: a systematic quantifiable methodology in Computer Science where there is a finite


set of feasible solutions to solve a specific problem or to achieve a specific condition or series of
conditions.
Arrow (Flowchart): a line with one and only one arrow head pointing to the next symbol in
the process.
End Terminator (Flowchart): an "END’Mabeled Terminator symbol in flowcharts that marks
the end of the entire flowchart.

Finite: has a limit or constraint.


Flowchart (Computer Programing): a visual aid showing a sequence of actions or
operations with only one entry and one exit points.
Low-level Solution: a specific solution which presents all the detailed information and
processes involved within.
Single-threaded Flow: a concept in flowcharting wherein there is only one allowed flow for
the sequence of processes.
Start Terminator (Flowchart): a "START"-labeled Terminator symbol in flowcharts that
marks the start of the entire flowchart.
Problem Solving: systematic approach in searching for a solution to a specific problem.
Pseudocode: an English-like high-level description of the processes in Computer Programming.

You might also like