Professional Documents
Culture Documents
Comp Prog 12 W3 W4
Comp Prog 12 W3 W4
Quarter 1 – Module 2
FLOWCHARTING
SELECT THE PROGRAM LOGIC DESIGN APPROACH
WEEKS 3 and 4
1
2
Introductory Message
For the facilitator:
This module was collaboratively designed, developed and evaluated by the Development and Quality
Assurance Teams of SDO TAPAT to assist you in helping the learners meet the standards set by the K
to 12 Curriculum while overcoming their personal, social, and economic constraints in schooling.
As a facilitator, you are expected to orient the learners on how to use this module. You also need to
keep track of the learners' progress while allowing them to manage their own learning. Furthermore,
you are expected to encourage and assist the learners as they do the tasks included in the module.
This module was designed to provide you with fun and meaningful opportunities for guided and
independent learning at your own pace and time. You will be enabled to process the contents of the
learning resource while being an active learner.
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. Don’t forget to answer Let’s Try before moving on to the other activities included in
the module.
3. Read the instruction carefully before doing each task.
4. Observe honesty and integrity in doing the tasks and checking your answers.
5. Finish the task at hand before proceeding to the next.
6. 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!
3
Lesson
FLOWCHARTING
2
Let’s Learn
At this point of the lesson, the learners will be assessed on what common
competencies from the NC III were still mastered. Some recalls and drills will
be done to ensure that the preparation for the national certifications is really
doing according to expectations. In case the mastery is showing
inconsistencies, retooling will be 100% repeated. In the event the students
will show proficiency, the focus will be to the application as preparation to
another programming language.
Let’s Try
PRE - ASSESSMENT
TEST I – FLOWCHARTING
Directions:
Read and analyze the problem. Create a flowchart solution. Solution will be
done on Microsoft Word Document. Send it to the destination given by the teacher.
A. Create a flowchart that will input two numbers. Add the two numbers
and display the sum.
4
TEST II – LABELLING
Directions: Identify what the Flowchart Symbol represents. Write the correct
answer on the space provided for every number.
1. ____________________________
2. _____________________________
3. _____________________________
4. _____________________________
5. _____________________________
6. _____________________________
5
L.O. 1: SELECT THE PROGRAM LOGIC DESIGN
APPROACH
PERFORMANCE STANDARD
The learners demonstrate an understanding of the concept and underlying
principles of designing program logic.
Let’s Recall
In this portion of the module, the learners will be given series of challenges as to
develop critical and creative thinking so when the actual programming is tackled,
they will find it fun and easy to learn the required competencies of the lessons. Some
exercises will enhance more their inner potentials to make the learners really
productive during the activity and performance tasks.
6
Let’s Explore
Let’s Elaborate
7
OBTAIN DESIGN DOCUMENTATION
Before you start coding a program it is necessary to plan the step by step
solution to the task your program will carry out. Such a plan can be
symbolically developed using a diagram. This diagram is then called a
flowchart. Hence a flowchart is a symbolic representation of a solution to a
given task. A flowchart can be developed for practically any job. Flowcharting
is a tool that can help us to develop and represent graphically program logic
sequence. It also enables us to trace and detect any logical or other errors
before the programs are written.
With this background of flowcharts and flowchart symbols let us now draw
some sample flowcharts. First we shall write the steps to prepare the flowchart
for a particular task and then draw the flowchart. The first design of flowchart
goes back to 1945 which was designed by John Von Neumann. Flowchart is
often considered as a BLUEPRINT of a design used for solving a specific
problem.
8
Here are some of the examples that will help in understanding the FLOWCHARTING concept!
Sample 1 - Sequence
Sample 2 - Selection
To prepare a flowchart to determine the greatest of two numbers. Here we use
the decision symbol. We also combine the two reads for numbers A and B in
one box.
9
Sample 3 – Loops
10
IDENTIFY SYSTEM SPECIFICATION AND
REQUIREMENTS
Flowcharts
Symbols and Descriptions
Names
Preparation
In situations, where the flowcharts become big, it may so
happen that the FLOWLINES start crossing each other at
many places causing confusion. A connector symbol is
indicated by a circle and a letter or a digit is placed in the
circle. This letter or digit indicates a link.
Connector
11
FLOWLINES are solid lines with arrowheads which indicate the
flow of operation. They show the exact sequence in which the
instructions are to be executed. The normal flow of the flowchart
FLOWLINES is depicted from top to bottom and left to right.
ALOGORITHM
The procedure must break up the problem solution into parts that the
recipient party can understand and execute. In the case of a computer, the
problem solution is usually in the form of a program that encompasses the
algorithm and explains to the computer a clearly defined procedure for
achieving the solution. The procedure must consist of smaller steps each of
which the computers understand.
12
Step 2 Define the variables: Algorithm's variables allow you to use it for more
than one place. We can define two variables for rectangle height and rectangle
width as HEIGHT and WIDTH (or H & W). We should use meaningful variable
name e.g. instead of using H & W use HEIGHT and WIDTH as variable name.
1. Sequence: In the sequence structure, statements are placed one after the
other and the execution takes place starting from up to down.
2. Branching (Selection): In branch control, there is a condition and
according to a condition, a decision of either TRUE or FALSE is achieved. In
the case of TRUE, one of the two branches is explored; but in the case of
FALSE condition, the other alternative is taken. Generally, the ‘IF-THEN’ is
used to represent branch control.
3. Loop (Repetition): The Loop or Repetition allows a statement(s) to be
executed repeatedly based on certain loop condition e.g. WHILE, FOR loops.
ADVANTAGES OF ALGORITHM
13
SELECT THE DESIGN APPROACH TO BE FOLLOWED
IN CODING
PSEUDOCODE
Pseudocode is one of the tools that can be used to write a preliminary plan
that can be developed into a computer program. Pseudocode is a generic way
of describing an algorithm without use of any specific programming language
syntax. It is, as the name suggests, pseudo code —it cannot be executed on a
real computer, but it models and resembles real programming code, and is
written at roughly the same level of detail.
Sample Design 1
Computer science textbooks often use pseudocode in their examples so that
all programmers can understand them, even if they do not all know the same
programming languages. Since pseudocode style varies from author to author,
there is usually an accompanying introduction explaining the syntax used.
In the algorithm design, the steps of the algorithm are written in free English
text and, although brevity is desired, they may be as long as needed to
describe the particular operation. The steps of an algorithm are said to be
written in pseudocode. Many languages, such as Pascal, have a syntax that
is almost identical to pseudocode and hence make the transition from design
to coding extremely easy.
The following section deal with the control structures (control constructs)
Sequence, Selection and Iteration or Repetition.
14
For example, suppose you are required to design an algorithm for finding the
average of six numbers, and the sum of the numbers is given. The pseudocode
will be as follows:
Pseudocode # 1
Start
Get the sum
Average = sum / 6
Output the average
Stop
Flowchart Illustration # 1
Pseudocode # 2:
Selection structures are also called case selection structures when there are
two or more alternatives to choose from. This structure can be illustrated in
a flowchart as follows:
Pseudocode 2
If condition is true
Then do task A
else
Do Task-B
15
Flowchart Illustration 2
The action is only taken when the test is true. The logical operators used in
our pseudo-code are
= is equal to
> is greater than
< is less than
>= is greater than or equal
<= is less than or equal
<> is not equal to
In everyday language we say things like If I had the time and the money I
would go on holiday. The and means that both conditions must be true
before we take an action. We might also say I am happy to go to the theatre
or the cinema. The logical link this time is or. Conditions in if statements
are linked in the same way. Conditions linked with and only result in an
action when all conditions are true.
For example, if a >b and a > c then displays “a is the largest”. Conditions
linked with an or lead to an action when either or both are true.
16
3. REPETITION OR ITERATION STRUCTURE
A third structure causes the certain steps to be repeated.
The syntax is
REPEAT
A statement or block of statements
UNTIL a true condition
Note:
A program segment repeatedly asks for entry of a number in the range 1 to
100 until a valid number is entered.
REPEAT
DISPLAY “Enter a number between 1 and 100”
ACCEPT number
UNTIL number < 1 OR number > 100
17
The WHILE loop
The second type of iteration we will look at is the while iteration. This type of
conditional loop tests for terminating condition at the beginning of the loop.
In this case no action is performed at all if the first test causes the terminating condition to
evaluate as false.
The syntax is
WHILE (a condition is true)
A statement or block of statements
ENDWHILE
Example 2: Write a program that will output the square root of any number
input until the number input is zero. In some cases, a variable has to be
initialized before execution of the loop as shown in the following example.
The third type of iteration, which we shall use when the number of iterations
is known in advance, is a for loop. This, in its simplest form, uses an
initialization of the variable as a starting point, a stop condition depending on
the value of the variable. The variable is incremented on each iteration until
it reaches the required value.
18
Example 1
FOR (n = 1, n <= 4, n + 1)
DISPLAY “loop”, n
ENDFOR
The fragment of code will produce the output
Loop 1
Loop 2
Loop 3
Loop 4
In the example, n is usually referred as the loop variable, or counting variable, or index of the
loop. The loop variable can be used in any statement of the loop. The variable should not be
assigned a new value within the loop, which may change the behavior of the loop.
Flowcharts have been used in this section to illustrate the nature of the three control structures.
These three are the basic control structures out of which all programs are built. Beyond this,
flowcharts serve the programmer in two distinct ways: as problem solving tools and as tools for
documenting a program.
Let’s Dig In
19
WORDED PROBLEM –TO– FLOWCHARTING CHALLENGE
Directions: The worded problem is given below; the student will create the
Flowchart equivalent to show mastery of the lesson.
(1) Create a flowchart that will input two numbers. Solve for the SUM,
DIFFRENCE, PRODUCT and QUOTIENT. Show the values computed.
(3) Create a flowchart that will enter the grade in Computer Programming
with the following components WW, PT and QA. To solve for the
semester grade, add the weighted scores of WW with 20% , PT with 60%
and QA with 20%. Identify if the grade computed is Passed or Failed.
Let’s Remember
DIRECTIONS: Read and analyze the questions below. Write your understanding on every
competency learned. Use separate sheet to answer for modular and new document for blended and
save it SN_Flowcharting.docx. Check the scoring RUBRIC for reference.
CRITERIA 5 3 1
Relevance The answer is complete in The answer is somehow The answer has little
contents and insights good in contents and content and insights
insights
Grammar The answer is The answer has some The answer have many
grammatically correct incorrect grammar incorrect grammar
20
Directions: Please complete the sentences below.
1. Flowcharting is helpful in programming because _____________________________
____________________________________________________________________.
2. I need to understand the problem before I use Flowcharting so it _________________
____________________________________________________________________.
3. If the problem is not well understood, this might possibly happen ________________
____________________________________________________________________.
4. To ensure balance learning before the programming proper, I must _______________
____________________________________________________________________.
5. As I create activity, Flowcharting makes me _________________________________
____________________________________________________________________.
Let’s Apply
21
Let’s Evaluate
____ 1. Every flowchart has a unique starting point and an ending point.
This flowchart symbol begins at the START and stops at the END.
a. Flow lines c. Terminal
b. Process d. Connector
____ 2. This symbol is used to denote any input/output function in the
program. Thus if there is any input to the program via an input device,
like a keyboard, tape, card reader etc.
a. I/O c. Terminal
b. Decision d. Connector
____ 3. This symbol is used to represent arithmetic and data movement
instructions in the flowchart. All arithmetic processes of addition,
subtraction, multiplication and division are indicated in the process
symbol.
a. Flow lines c. Terminal
b. Process d. Connector
____ 4. This symbol is used in a flowchart to indicate the point where a
decision is to be made and branching done upon the result of the
decision to one or more alternative paths.
a. Decision c. Preparation
b. Process d. I/O
____ 5. This symbol is being used to provide a constant variable to be
used in the flowchart.
a. Preparation c. Terminal
b. Process d. Decision
____ 6. It is a diagram made up of boxes, diamonds and other shapes,
connected by arrows - each shape represents a step in the process, and
the arrows show the order in which they occur. It combines symbols
and flow lines, to show figuratively the operation of an algorithm.
a. Procedure c. Sequence
b. Flowchart d. Algorithm
____ 7. In situations, where the flowcharts become big, it may so happen
that the FLOWLINES start crossing each other at many places causing
confusion. This symbol is indicated by a circle and a letter or a digit is
placed in the circle. This letter or digit indicates a link.
a. Flow lines c. Preparation
b. Decision d. Connector
____ 8. These are solid lines with arrowheads which indicate the flow of
operation. They show the exact sequence in which the instructions are
22
to be executed. The normal flow of the flowchart is depicted from top to
bottom and left to right.
a. I/O c. Flow lines
b. Process d. Connector
____ 9. It is like a procedure in a certain activity or program. It is a
representation of a solution to a problem.
c. Procedure c. Sequence
d. Flowchart d. Algorithm
____ 10. In the Flowchart structure, statements are placed one after the
other and the execution takes place starting from up to down.
a. Branching (selection) c. Loop (repetition)
b. Sequence d. Flowchart
____ 11. In this Flowchart, there is a condition and according to a
condition, a decision of either TRUE or FALSE is achieved. In the case
of TRUE, one of the two branches is explored; but in the case of FALSE
condition, the other alternative is taken. Generally, the ‘IF-THEN’ is
used to represent branch control.
a. Branching (selection) c. Loop (repetition)
b. Sequence d. Flowchart
____ 12. This Flowchart allows a statement(s) to be executed repeatedly
based on certain loop condition e.g. WHILE, FOR loops.
a. Branching (selection) c. Loop (repetition)
b. Sequence d. Flowchart
____ 13. This is one of the tools that can be used to write a preliminary
plan that can be developed into a computer program. This is a generic
way of describing an algorithm without use of any specific programming
language syntax.
a. Procedure c. Algorithm
b. Pseudocode d. Flowcharting
____ 14. The second type of iteration or loop we will look at is the while
iteration. This type of conditional loop tests for terminating condition at
the beginning of the loop.
a. Loop c. While loop
b. For loop d. Decision
____ 15. This iteration or loop, in its simplest form, uses an initialization
of the variable as a starting point, a stop condition depending on the
value of the variable.
a. Loop c. While loop
b. For loop d. Decision
23
Let’s Extend
INSTRUCTIONS:
INSTRUCTIONS:
For self-improvement, look for any transaction slip made, problem or business
related, case study for analysis and apply the basic concepts learned such as
Algorithm, Pseudocode and Flowchart solution. Create three samples showing
levels of difficulty such as SEQUENCE, SELECTION and LOOP.
Reminders:
The students may submit it or not. Students who will submit will receive extra
plus points in case the work is correct and those who submitted with incorrect
work will be guided. Students who will not submit will not be given minus
points however, he/she will be given some oral recitations the next day.
Requirements:
1. To be done using Microsoft Word containing (1) Worded Problem (2)
Algorithm (3) Pseudocode (4) Flowchart
2. Submit it on the teacher’s email joelmburgos2020@gmail.com
24
REFERENCES
BOOKS:
Application Programming 1 Using VB.Net by CAL Philippines
YOUTUBE:
(38) Introduction to Creating Flowcharts - YouTube
(38) Creating a Simple Flowchart in Microsoft Word. - YouTube
(38) FLOWCHART AND ALGORITHM SAMPLE PROBLEMS TAGALOG |
Beginners Guide 2020 - YouTube
(38) FLOWCHART AND ALGORITHM SAMPLE PROBLEMS FOR
LOOPS/REPETITION STRUCTURE | Beginners Guide 2020 - YouTube
(38) FLOWCHART AND ALGORITHM SAMPLE PROBLEMS WITH DECISIONS
OR CONDITIONS Tagalog | Beginners Guide 2020 - YouTube
25
DEVELOPMENT TEAM OF THE MODULE
Writer : JOEL M. BURGOS
Content Editor : JASPER T. AGUILAR
Language Editor : JASPER T. AGUILAR
Reviewer : DR.ANGELA K. ALAMAN, Head Teacher IV-SVNHS
Illustrator : JASPER T. AGUILAR
Schools Division of Taguig city and Pateros Upper Bicutan Taguig City
Telefax: 8384251
26
27