Professional Documents
Culture Documents
"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.
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 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.
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.
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
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