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

Programming Q2 Weeks1to4

Uploaded by

maeyonnaise127
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Programming Q2 Weeks1to4

Uploaded by

maeyonnaise127
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

8

Technical-Vocational
Education - ICT
Computer Programming
Quarter 2
Modules 1 - 4
8
Technical-Vocational
Education - ICT
Computer Programming
Quarter 2 – Module 1:
Overview of Programming
TVE – ICT (Computer Programming) 8
Alternative Delivery Mode
Quarter 2 – Module 1: Overview of Programming
First Edition, 2020

Republic Act 8293, section 176 states that: No copyright shall subsist in any work of the
Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such
agency or office may, among other things, impose as a condition the payment of royalties.

Borrowed materials (i.e., songs, stories, poems, pictures, photos, brand names, trademarks, etc.)
included in this module are owned by their respective copyright holders. Every effort has been
exerted to locate and seek permission to use these materials from their respective copyright
owners. The publisher and authors do not represent nor claim ownership over them.

Published by the Department of Education – Schools Division Office of Makati City


OIC-Schools Division Superintendent: Carleen S. Sedilla CESE
OIC-Assistant Schools Division Superintendent/OIC-Chief, CID: Jay F. Macasieb, DEM, CESE

Development Team of the Module

Writer: Jean T. Tumaneng

Editor: Arlene A. Purisima

Reviewer: Celedonia T. Teneza EdD

Layout Artist: Jean T. Tumaneng

Management Team:

Neil Vincent C. Sandoval


Education Program Supervisor, LRMS

Celedonia T. Teneza EdD


Education Program Supervisor, EPP/TLE/TVL

Printed in the Philippines by the Schools Division Office of Makati City


Through the Support of the City Government of Makati (Local School Board)

Department of Education – Schools Division Office of Makati City

Office Address: Gov. Noble St., Brgy. Guadalupe Nuevo


City of Makati, Metropolitan Manila, Philippines 1212
Telefax: (632) 8882-5861 / 8882 - 5862
E-mail Address: [email protected]

ii
What I Need to Know

Hello, Grade 8 Learners! This module is designed to help you fully understand
the Overview of Programming and some basic programming terms. Feel free to explore
each part and accomplish each activity at your own pace.
This module is here to guide you through this lesson. In case you were not able
to follow and understand some instances, you can always go back to that part.
Are you ready? Let us start.
The module is composed of one (1) lesson, namely:
• Lesson 1 – Overview of Programming
After going through this module, you are expected to:
1. familiarize oneself with the origin of programming;
2. create simple program logic;
3. describe program logic;
4. describe program syntax;
5. recognize syntax errors from logical errors.

What I Know

Choose the letter of the best answer. Write the chosen letter on a separate sheet of
paper.
1. One of the major tasks of a computer programmer is to write instructions to
create a computer program. Which of the following terms is also known as a
computer program?
A. Data
B. Hardware
C. Information
D. Software

2. Programmers write computer instructions using programming languages.


Which of the following is NOT a programming language?
Ada
B. Adobe
C. C++
D. Pascal
3. Who was the world’s first recognized computer programmer?
a. Augusta Ada Byron
B. Bell Labs
C. Brenda Eich
a. D. Niklaus Wirth
4. Producing output before accepting input. What type of error is this?
a. Logical
b. syntax
c. either logical or syntax
d. both logical and syntax
5. If there is Misspelled programming language word, it will return what type of
error?
a. Logical
b. syntax
c. either logical or syntax
d. both logical and syntax

1
Lesson
Overview of Programming
1

What’s In

Let us have a quick recap on our last module on Computer Network and
Network devices by answering these guide questions.

1. How is computer network defined?


2. What are the different types of network?
3. What is network topologies and what are its types?

What’s New

Activity 1. Decode It. Reveal the hidden words behind


each number using the Source Code table at the
right.
For each number combination, the first digit represents
the column while the second digit represents the row. COLUMN
1 2 3 4 5
For example: 0 A K P U
31 35 51 15 1 B F L V
ROW

2 G M Q W
3 C H R X
L O V E 4 D I N S Y
5 E J O T Z
1. 13 35 32 40 24 31 15 43 Source Code Table
2. 31 24 34 30 15 43
3. 44 54 34 45 10 53
4. 31 35 22 24 13
5. 54 50 30 24 23 24 43 35

What is It

History of Programming Languages

TIME LANGUAGE DEVELOPER Short Description


LINE
1883 Algorithm for Ada Lovelace • for Charles Babbage’s Analytical Engine
the Analytical to compute Bernoulli numbers
Engine • it is the first computer programming
language.
1949 Assembly • first widely used in the Electronic Delay
Language Storage Automatic Calculator,
• a low-level computer programming
language that simplifies the language of

2
machine code, the specific instructions
needed to tell the computer what to do.
1952 Autocode Alick Glennie • generic term for a family of early computer
programming languages
• for the Mark 1 computer at the University
of Manchester in the U.K
1958 Algol A Committee • Algol stands for Algorithmic Language.
• Algol served as a starting point in the
development of languages such as Pascal,
C, C++, and Java
1959 COBOL Dr. Grace • It is used in ATMs, credit card processing,
(COmmon Murray Hopper telephone systems, hospital and
Business government computers, automotive
Oriented systems, and traffic signals.
Language) • In the movie The Terminator, pieces of
COBOL source code were used in the
Terminator’s vision display.
1959 LISP (LISt of John McCarthy • It was originally created for artificial
Processing intelligence research but today can be
language) used in situations where Ruby or Python
are used.
1964 BASIC John G. Kemeny • for students who did not have a strong
(Beginner’s A and Thomas E. technical or mathematical understanding
ll- Kurtz so that they could still use computers
purpose Sym • A modified version of BASIC was written by
bolic Instruct Bill Gates and Paul Allen. This was to
ion Code become the first Microsoft product
1970 Pascal Niklaus Wirth • named in honor of the French
mathematician, physicist, and philosopher
Blaise Pascal.
• It is easy to learn and was originally
created as a tool for teaching computer
programming.
1972 Smalltalk Alan Kay, Adele • allowed computer programmers to modify
Goldberg, and code on the fly and introduced other
Dan Ingalls aspects now present in common computer
programming languages including Python,
Java, and Ruby.
1972 C Dennis Ritchie • considered by many to be the first high-
level language
• was created so that an operating system
called Unix could be used on many
different types of computers. It has
influenced many other languages,
including Ruby, C#, Go, Java, JavaScript,
Perl, PHP, and Python
1972 SQL Donald D. • It is used for viewing and changing
(Structured Chamberlin and information that is stored in databases.
Query Langu Raymond F. SQL uses command sentences called
age) Boyce queries to add, remove, or view data
1978 MATLAB Cleve Moler • it is one of the best computer
(Matrix Labo programming languages for writing
ratory) mathematical programs and is mainly
used in mathematics, research, and
education.
• it can also be used to create two- and
three-dimensional graphics
1983 Objective C Brad Cox and • is the main computer programming
Tom Love language used when writing software for
macOS and iOS, Apple’s operating
systems
1983 C++ Bjarne • an extension of the C language used in
Stroustrup game engines and high-performance
software like Adobe Photoshop.

3
• Most packaged software is still written in
C++.
1987 Perl Larry Wall • a scripting language designed for text
editing. Its purpose was to make report
processing easier.
• it is now widely used for many purposes,
including Linux system administration,
Web development, and network
programming
1990 Haskell Haskell Brooks • a purely functional computer
Curry programming language, which basically
means that it is mostly mathematical.
• it is used by many industries, especially
those that deal with complicated
calculations, records, and number-
crunching
1991 Python Guido Van • easier to read and requires fewer lines of
Rossum code than many other computer
programming languages
• it was named after the British comedy
group Monty Python. Popular sites like
Instagram use frameworks that are
written in Python
1991 Visual Basic Microsoft • allows programmers to choose and
change pre-selected chunks of code in a
drag-and-drop fashion through a
graphical user interface (GUI).
1993 R Ross Ihaka and • named after the first names of the first
Robert two authors
Gentleman • it is mostly used by statisticians and
those performing different types of data
analysis.
1995 Java Sun • Originally called Oak
Microsystems • it was intended for cable boxes and hand-
held devices but was later enhanced so it
could be used to deliver information on
the World Wide Web
• Java is everywhere, from computers to
smartphones to parking meters. Three
billion devices run Java!
1995 PHP Rasmus Lerdorf • used mostly for Web development and is
(Personal Ho usually run on Web servers now widely
me Page) used to build websites and blogs.
• WordPress, a popular website creation
tool, is written using PHP.
1995 Ruby Yukihiro “Matz” • combined parts of his favorite languages
Matsumoto to form a new general-purpose computer
programming language that can perform
many programming tasks
• it is popular in Web application
development.
• Ruby code executes more slowly, but it
allows for computer programmers to
quickly put together and run a program
1995 Javascript Brendan Eich • mostly used to enhance many Web
browser interactions
• Almost every major website uses
Javascript.
2000 C# Microsoft • combining the computing ability of C++
with the simplicity of Visual Basic, C# is
based on C++ and is like Java in many
aspects
• it is used in almost all Microsoft products
and is primarily used for developing
desktop applications.

4
2003 Scala Martin Odersky • a computer programming language that
combines functional programming, which
is mathematical, with object-oriented
programming, which is organized around
data that controls access to code
• Its compatibility with Java makes it
helpful in Android development.
2003 Go Google • address problems that can occur in large
software systems. Since computer and
technology use is much different today
than it was when languages such as C++,
Java, and Python were introduced and
used, problems arose when huge
computer systems became common.
• it was intended to improve the working
environment for programmers so they
could write, read, and maintain large
software systems more efficiently.
2014 Swift Apple • replacement for C, C++, and Objective-C,
Swift is supposed to be easier to use and
allows less room for mistakes
• It is versatile and can be used for desktop
and mobile apps and cloud services.
Table 1. History of Programming Languages

Programming Defined

 The process of developing and implementing various sets of instructions to enable


a computer to do a certain task.
 The act or process of planning or writing a program.

Program Defined
• A program is written as a series of human understandable computer
instructions that can be read by a compiler or interpreter.

Three (3) Major Operations in Programming

1. Input – data items enter the computer system and are placed in memory, where they
can be processed
2. Processing – data items are organized or sorted, checked for accuracy and performs
calculations
3. Output – after data items have been processed, the resulting information usually is
sent to an output or storage devices

input operation input anyNumber

processing operation set doubledNumber = anyNumber * 2

output operation output doubledNumber

Figure 1. Number Doubling Program

Example 1 shows a simple program logic that includes the three (3) major operations
in programming. A program Logic is defined as a specific sequence of program
instructions. Incorrect sequence of instructions produces incorrect output or logical
error/s. These instructions written using a programming language is called program
Code. Coding a program is also known as writing instructions. The instructions
written in a specific programming language is called source code. This source code is
translated into a machine-readable language (object code) in the form of on/off

5
circuits (Os and 1s) within the computer by a compiler/interpreter. In writing a
program, there are rules governing its word usage and punctuation. This is called the
language’s syntax. Any mistake in a language’s use will return a syntax error. Syntax
errors are easy to locate and correct because the complier/interpreter highlights them.
On the other hand, a program with no syntax error is translatable and can execute,
but still might contain logical errors. Table 2 gives a quick view of this concept.

WITH SYNTAX WITHOUT SYNTAX


ERROR ERROR
WITH
LOGICAL NOT EXECUTABLE EXECUTABLE
ERROR
WITHOUT
LOGICAL NOT EXECUTABLE EXECUTABLE
ERROR

Table 2. Error Matrix

What’s More

Activity 2. Matching Game. Accomplish the activity by drawing a line from the
Timeline column to the Programming Language column to match the correct
items based on the History of Programming Languages discussed.

Timeline Programming Language

1995 Scala

1983 C++

1959 Javascript

2003 Visual Basic

1991 COBOL

Activity 3. Analysis Check. Identify what error is produced for each situation.
Draw a single underline on the Logic segment and double underline on the syntax
segment.

1. A punctuation mark is missing in a statement and the sequence is correct.

2. Added two numbers instead of multiplying and no misspelled word nor incorrect
punctuation was used.

3. The sequence and operation used is correct and no misspelled word nor incorrect
punctuation was used.

4. Typed niput instead of input and the sequence and operation are correct.

5. Used colon instead of semicolon after the statement and used the correct operator in
dividing.

6
What I Have Learned

Fill in the blanks by supplying the correct answer.


1. ________________ is the process of developing and implementing various sets of
instructions to enable a computer to do a certain task.
2. ___________________________________ is written as a series of human
understandable computer instructions that can be read by a compiler or
interpreter.
3. The three (3) major operations in programming are:
a. ______________
b. ______________
c. ______________
4. The difference between a program logic and a language’s syntax is
__________________________________________________________________________.
5. A program is executable if ________________________________________________.It is
not executable if ____________________________________.

What I Can Do

Activity 4. Evaluation Check. Simply put a check (√) mark if the column identifier
applies to the case. Put a cross (x) mark if otherwise.

Case Syntax Logical Executable Not


Error Error Executable
1. A punctuation mark is missing in a
statement and the sequence is correct.
2. Added two numbers instead of multiplying
and no misspelled word nor incorrect
punctuation was used.
3. The sequence and operation used are
correct and no misspelled word nor
incorrect punctuation was used.
4. Typed niput instead of input and the
sequence and operation are correct.
5. Used colon instead of semicolon after the
statement and used the correct operator in
dividing.

Assessment

Multiple Choice. Choose the letter of the best answer. Write the chosen letter on a
separate sheet of paper.
1. This programming language served as a starting point in the development of languages
such as Pascal, C, C++, and Java. What is this programming language?
a. Algol b. Autocode c. C++ d. Pascal
2. In 1991, a programming language was developed by Microsoft that allowed
programmers to choose and change pre-selected chunks of code in a drag-and-drop fashion.
a. Python b. Ruby c. Swift d. Visual Basic
3. Javascript is mostly used to enhance many Web browser interactions today. Who developed
this programming language?
a. Brendan Eich b. Martin Odersky c. Rasmus Lerdorf d. Yukihiro Matsumoto
4. Go was developed by Google in 2003 for a specific purpose. Which of the following statements
describes the intention of developing this language?

7
a. it was intended to improve the working environment for programmers so they could write,
read, and maintain large software systems more efficiently
b. it combines functional programming, which is mathematical, with object-oriented
programming, which is organized around data that controls access to code
c. it executes more slowly, but it allows for computer programmers to quickly put together
and run a program
d. it was intended for cable boxes and hand-held devices but was later enhanced so it could
be used to deliver information on the World Wide Web
5. COBOL was the programming language used in ATMs, credit card processing, telephone
systems, hospital and government computers, automotive systems, and traffic signals. What
does the acronym COBOL stand for?
a. Code of Basic Operating Language
b. Common Business Oriented Language
c. Comprehensive Business Oriented Language
d. Credit Operating Business Oriented Language
6. Which of the following terms is defined as the process of developing and implementing various
sets of instructions to enable a computer to do a certain task.
a. Coding b. Encoding c. Programming d. Writing
7. Regardless of programming language used, they follow the three (3) major operations in
programming. What are these operations in correct order?
a. input, processing, output
b. input, storing, output
c. processing, input, storing
d. storing, input, processing
8. From the three (3) major operations, data items are organized or sorted, checked for accuracy
and performs calculations, which operation is described?
a. input
b. output
c. processing
d. all the above
9. All programming languages are governed by rules. What term in programming is used for these
rules?
a. format
b. logic
c. options
d. syntax
10. What is the most important task of a compiler or interpreter?
a. creates the rules for a programming language
b. executes the object code to perform necessary tasks
c. translates the English statements into a programming language
d. translates the language statements into machine language

For inquiries or feedback, please write or call:

Department of Education – Schools Division Office of Makati City

Gov. Noble St., Brgy. Guadalupe Nuevo


City of Makati, Metropolitan Manila, Philippines 1212

Telefax: (632) 8882-5861 / 8882-5862

Email Address: [email protected]

8
8
Technical-Vocational
Education - ICT
Computer Programming
Quarter 2 – Module 2:
Program Development Cycle
TVE – ICT (Computer Programming) 8
Alternative Delivery Mode
Quarter 2 – Module 2: Program Development Cycle
First Edition, 2020

Republic Act 8293, section 176 states that: No copyright shall subsist in any work of the
Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such
agency or office may, among other things, impose as a condition the payment of royalties.

Borrowed materials (i.e., songs, stories, poems, pictures, photos, brand names, trademarks, etc.)
included in this module are owned by their respective copyright holders. Every effort has been
exerted to locate and seek permission to use these materials from their respective copyright
owners. The publisher and authors do not represent nor claim ownership over them.

Published by the Department of Education – Schools Division Office of Makati City


OIC-Schools Division Superintendent: Carleen S. Sedilla CESE
OIC-Assistant Schools Division Superintendent/OIC-Chief, CID: Jay F. Macasieb, DEM, CESE

Development Team of the Module

Writer: Jean T. Tumaneng

Editor: Arlene A. Purisima

Reviewer: Celedonia T. Teneza EdD

Layout Artist: Jean T. Tumaneng

Management Team:

Neil Vincent C. Sandoval


Education Program Supervisor, LRMS

Celedonia T. Teneza EdD


Education Program Supervisor, EPP/TLE/TVL

Printed in the Philippines by the Schools Division Office of Makati City


Through the Support of the City Government of Makati (Local School Board)

Department of Education – Schools Division Office of Makati City

Office Address: Gov. Noble St., Brgy. Guadalupe Nuevo


City of Makati, Metropolitan Manila, Philippines 1212
Telefax: (632) 8882-5861 / 8882 - 5862
E-mail Address: [email protected]

ii
What I Need to Know

Hello, Grade 8 Learners! This module is designed to help you fully understand
the Program Development Cycle and some more basic programming terms. Feel free to
explore each part and accomplish each activity at your own pace.
This module is here to guide you through this lesson. In case you were not able
to follow and understand some instances, you can always go back to that part.
Are you ready? Let us start.
The module is composed of one (1) lesson, namely:
• Lesson 1 – Program Development Cycle
After going through this module, you are expected to:
1. familiarize oneself with the Program Development Cycle;
2. recognize the importance of each phase in the Program Development Cycle.

What I Know

Choose the letter of the best answer. Write the chosen letter on a separate sheet of
paper.
1. Programmers write program to satisfy the needs of others, called the users. They
just do not sit down and start typing. They follow a program development cycle
which is broken into seven steps. Which of the following items shows the correctly
sequenced program development cycle?
a. Understand the Problem ->Plan the Logic ->Write the Code->Translate the
Code->Test the Program->Put the Program into Production->Maintain the
Program
b. Understand the Problem ->Test the Program ->Write the Code->Translate
the Code->Plan the Logic->Put the Program into Production->Maintain the
Program
c. Understand the Problem ->Translate the Code ->Maintain the Program-
>Test the Program->Plan the Logic->Put the Program into Production->Write
the Code
d. Understand the Problem ->Write the Code ->Maintain the Program-
>Translate the Code->Plan the Logic->Put the Program into Production-
>Test the Program
2. Planning the logic is considered as more difficult than actually coding the
program. Which pair shows the two most common planning tools?
a. ASCII and EBCDIC
b. FLOWCHARTS and PSEUDOCODE
c. IPO and TOE
d. TOE and UML
3. Which of the following statements best describe the goal why programmers write
program?
a. Good programs can be made better over time.
b. To earn money by creating various programs for different purposes.
c. To prove that programmers can create impossible things.
d. To satisfy the needs of organizations, agencies, and other entities.
4. Of the phases in the Program Development Cycle, which phase is considered the
heart of programming?
a. Planning the Logic
b. Testing the Code
c. Understanding the Problem
d. Writing the Code
5. When can the programmer only write the code?
a. after the program has been tested
b. anytime in the program development process
c. when the logic is planned
d. when the problem is fully understood

1
Lesson
Program Development Cycle
1

What’s In

Let us have a quick recap on our last module on Overview of Programming devices
by answering these guide questions.

1. What is Programming
2. Can you enumerate at least five (5) programming language with their respective
creator or developer?
3. What is the difference between logic and syntax and logical error with syntax
error?

What’s New

Activity 1. Educational Bingo. Below is a Bingo Card with Years, Programming


Language Developers and Programming Languages written in each box. Select a
preferred pattern, it may be horizontal, vertical of diagonal. If the given is Year, state the
Programming Language and its Developer. If the given is Programming Language, state
the year when it was developed and the developer. If the given is Developer, state the
Programming Language developed and its year. Cross the item if you got the answers
correctly. Otherwise, you may look for another pattern. You got a perfect score once you
were able to cross out all boxes in a pattern.

Assembly Alick
1991 Ada Lovelace 1959
Language Glennie

Nicklaus
COBOL 1964 Pascal Smalltalk
Wirth

Bjarne
C SQL FREE Larry Wall
Stroustrop

Guido Van
Haskell Microsoft 1995 PHP
Rossum

Yukihiro
Ruby C# Scala Google
Matsumoto

Congratulations! You did a nice job.

2
What is It

Programmers develop programs to satisfy the needs of his environment. This


environment may be an organization, agency or an individual who wishes to make things
easier, faster, and more accurate. Programming is not as simple as what you saw
programmers in videos or images that just sit down and type characters. The whole job
involves writing the instructions, but a professional one follows a cycle called the
Program Development Cycle which can be broken down into at least seven (7) phases.

Program Development Cycle

Figure 1 shows the seven (7) phases of the Program


Development Cycle. Each phase plays important
roles in the development of a quality program.

The phases are listed as follows:

1. Understand the Problem


2. Plan the Logic
3. Write the Code
4. Translate the Code
5. Test the Program
6. Put the Program into Production
7. Maintain the Program
Figure 1. Program Development Cycle

Let us discuss and try to recognize the importance of each phase.

1. Understand the Problem.


Programmers are also known as problem solvers. Whose problems do they solve?
The users or end users’ problems. Example of end users include Records Sections of an
organization, say the Department of Education, that needs a printed list of students
who enrolled in a particular school year, a Grocery Store that needs an immediate
update on stocks availability, and an Order/Delivery department of a fast-food chain
that needs to respond customers’ orders for delivery as fast as possible.
In this phase, you need to discuss with the end user the desired output to plan the
input and processing steps to achieve it.
Let us take the fast-food chain that needs to respond customers’ orders for delivery
as fast as possible. Ask as many questions as you can during this phase to help
understand the end user’s specifications. Some questions may include the following:
a. Does the end user wants a list of menus where the customer can choose from?
b. Does he want a summary of customers’ total bill?
c. Does the user wants to know the exact location of the customer?
d. What promotions are available once the order was delivered late to the customer?

On the part of the user, he is required to decide on the following:


a. What data should be included in the menu?
b. What data are to be collected from the customers?
c. Will there be discounts for customers for frequently repeated orders.

Documentation is provided to the programmer to help him understand the problem.


This includes original paperwork of the existing system. sample input, processing, and
outputs.

3
2. Planning the Logic

During this phase, the programmer plans the sequence (logic) of the program,
deciding what operations to include and how to order them. This makes this phase
considered as the heart of programming. This phase is also referred to by other
programmers as “developing an algorithm”. An algorithm is the sequence of steps or
rules a programmer follows to solve the problem. Planning the logic includes planning
tools. The most common planning tools are: 1) Pseudocode and 2) Flowcharts. Other
planning tools includes IPO (Input Process Output) chart, TOE (Tasks Objects Events)
chart, and UML (Unified Modelling Language). These are frequently used in interactive,
object – oriented applications.
To check if the logic is correct by providing the correct output, a programmer conducts
desk-checking.

3. Coding the Program

Once the program logic is developed, coding the program starts. It is also termed as
writing instructions. In coding, hundreds of programming languages are available. The
preference in choosing what language to be used depends primarily on the purpose of
the software to be developed. Programming languages are different in terms of their
capabilities to handle certain types of operations and their level of efficiency.
Nevertheless, they are quite alike in their basic capabilities, that is to handle the three
(3) major operations in programming and other standard functions.
It also in this phase where learning the syntax of a programming language to be
used is necessary.

4. Translating the Code

The code is translate using a software called compiler or interpreter. This software
translates the program English-like high – level programming language (source code)
to a low – level machine language (object code) in form of on/off switchers (Os and 1s).
Although there are many programming languages, only one language can the computer
understand, and this is the object code.
After translating, the programmer receives syntax errors in cases of misspellings,
missing punctuation marks and other violations on the language’s syntax. These errors
are never considered difficult for programmers since the compiler highlights the part of
the program where a syntax error exists.
In module 1, it is presented there the instances when a program is executable or
not. The diagram below shows how to create an executable program.

Data the
program
uses

if no syntax
Write and correct Compile the error Executable
the program code program program

if syntax
errors exist

List of
Program
syntax error
messages output

Figure 2. Flowchart segment of an executable program


4
5. Testing the Program

In this phase, the logic of the program is of utmost importance. As discussed in the
previous module, a program with no syntax error, although executable, may not mean
free from logical errors.
To do this, a programmer uses different sets of data to test the program. Let us use
the Number – doubling program to do some testing.

input anyNumber
set doubledNumber = anyNumber * 2
output doubledNumber

When the program executes and you provided the value 3 as input to the program, and
the output displayed is 6. Your program is correct. However, if the output displayed is
66, there seems to be a logical error. Your program maybe written as follows:

input anyNumber The programmer typed


set doubledNumber = anyNumber * 22 22 instead of 2.
output doubledNumber

This scenario is an example of logical error because the desired output is not achieved.

6. Putting the Program into Production

Once the program has been tested thoroughly, no syntax error and more importantly
no logical error, it is now ready for the end user to use. Part of this phase is to run the
program once for the end user to check if all specifications were followed. Also, the
people who will be using may undergo training on the use of the program.

7. Maintaining the Program

When necessary changes are to be made in the program, it is called maintenance.


Maintenance is done due to the following reasons:
a. new specifications required by the end user
b. the format of an input file is altered
c. new rates are legislated and
d. an existing program written by a previous programmer that needs to be enhanced
When you maintain a program that is previously written by a different programmer, you
ought to repeat the program development cycle.

5
What’s More

Activity 2. Drag & Drop. The box below contains the seven (7) phases in the
Program Development Cycle. Place each phase on the diagram correspondingly.

Planning the Logic Write the Code


Put the Program into Production
Understand the Problem

Test the Program


Plan the Logic Translate the Program

Activity 3. Scenario Identification. For each scenario given, identify what phase in
the Program Development Cycle it belongs.

1. The programmer inputs series of data to check if the result desired is correct.

2. The programmer is using a specific programming language while developing the


program.

3. The end user runs the program at once and checks if the desired specifications were
followed.

4. The programmer uses a software to check syntax errors.

5. The programmer uses Pseudocode in writing the sequence of the program.

6
What I Have Learned

Fill in the blanks by supplying the correct answer.


1. What is the first phase in the Program Development Cycle?
2. The seven (7) phases in the Program Development Cycle are:
a. ____________
b. ____________
c. ____________
d. ____________
e. ____________
f. ____________
g. ____________
3. A _____________________ is a software that translates a high – level language into
machine language and indicates if you have used a programming language
incorrectly.
4. What are two (2) most commonly used planning tools?
5. What might be the reasons for maintaining a program?

What I Can Do

Activity 4. Analysis Check. Below is a Pseudocode program to compute the area of a


polygon. Determine what phases in the Program Development Cycle is done
at this stage.

start
input length, width
set area = length * width
output area
stop

Assessment

True or False. Read and understand each statement. Write the word TRUE if the
statement is correct. Otherwise, write the word FALSE on the space provided before
each item.

_____ 1. Understanding the problem that must be solved can be one of the most
difficult aspects of programming.
_____ 2. The two most commonly used logic planning tools are IPO chart and
Flowchart.
_____ 3. Flowcharting a program is a very different process if you use an older
programming language instead of a newer one.
_____ 4. If the end user wants to add more specifications to an existing program, the
programmer will maintain the program. In this case, the programmer will
repeat the whole Program Development Cycle.
_____ 5. High – level programming language is the only language the computer
understands.

7
References
Webliography

Joyce Farrell. 2015. Programming Logic and Design Comprehensive Version, Eighth Edition. United States of
America: GEX Publishing Services

For inquiries or feedback, please write or call:

Department of Education – Schools Division Office of Makati City

Gov. Noble St., Brgy. Guadalupe Nuevo


City of Makati, Metropolitan Manila, Philippines 1212

Telefax: (632) 8882-5861 / 8882-5862

Email Address: [email protected]

8
8
Technical-Vocational
Education - ICT
Computer Programming
Quarter 2 – Module 3:
Planning Program Logic by
Writing Pseudocode
TVE – ICT (Computer Programming) 8
Alternative Delivery Mode
Quarter 2 – Module 3: Planning Program Logic by Writing Pseudocode
First Edition, 2020

Republic Act 8293, section 176 states that: No copyright shall subsist in any work of the
Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such
agency or office may, among other things, impose as a condition the payment of royalties.

Borrowed materials (i.e., songs, stories, poems, pictures, photos, brand names, trademarks, etc.)
included in this module are owned by their respective copyright holders. Every effort has been
exerted to locate and seek permission to use these materials from their respective copyright
owners. The publisher and authors do not represent nor claim ownership over them.

Published by the Department of Education – Schools Division Office of Makati City


OIC-Schools Division Superintendent: Carleen S. Sedilla CESE
OIC-Assistant Schools Division Superintendent/OIC-Chief, CID: Jay F. Macasieb, DEM, CESE

Development Team of the Module

Writer: Jean T. Tumaneng

Editor: Arlene A. Purisima

Reviewer: Celedonia T. Teneza EdD

Layout Artist: Jean T. Tumaneng

Management Team:

Neil Vincent C. Sandoval


Education Program Supervisor, LRMS

Celedonia T. Teneza EdD


Education Program Supervisor, EPP/TLE/TVL

Printed in the Philippines by the Schools Division Office of Makati City


Through the Support of the City Government of Makati (Local School Board)

Department of Education – Schools Division Office of Makati City

Office Address: Gov. Noble St., Brgy. Guadalupe Nuevo


City of Makati, Metropolitan Manila, Philippines 1212
Telefax: (632) 8882-5861 / 8882 - 5862
E-mail Address: [email protected]

ii
What I Need to Know

Hello, Grade 8 Learners! This module is designed to help you fully understand
how to plan a program logic using Pseudocode statements and some more basic
programming terms. Feel free to explore each part and accomplish each activity at your
own pace.
This module is here to guide you through this lesson. In case you were not able
to follow and understand some instances, you can always go back to that part.
Are you ready? Let us start.
The module is composed of one (1) lesson, namely:
• Lesson 1 – Planning Program Logic by Writing Pseudocode
After going through this module, you are expected to:
1. define the term Pseudocode;
2. apply Pseudocode standards;
3. recognize the different preserved Pseudocode terms and their functions;
4. familiarize oneself with the mathematical operations and operators in processing
data;
5. desk – check pseudocode statements;
6. plan a program logic by writing Pseudocode.

What I Know

Choose the letter of the best answer. Write the chosen letter on a separate sheet of
paper.

1. When programmers plan the logic for a solution to a problem, planning tools are
often used. Which of the following planning tools is described as an English – like
representation of the logical steps?
a. Flowchart
b. IPO Chart
c. Pseudocode
d. TOE Chart

2. Below is the Pseudocode program of a Number – doubling program. Which of the


following Pseudocode programs complies with the Pseudocode standards?

a. b.
start start
input anyNumber input anyNumber;
set doubledNumber = anyNumber * 2 set doubledNumber = anyNumber * 2;
output doubledNumber output doubledNumber;
stop stop

c. d.
start start
input anyNumber Input: anyNumber
set doubledNumber = anyNumber * 2 set: doubledNumber = anyNumber * 2
output doubledNumber output: doubledNumber
stop stop

1
3. What preserved Pseudocode term/word is used to display data or information?
a. input
b. output
c. set
d. start

4. If the preserved Pseudocode word input is good as read, which of the following
preserved Pseudocode word is good as compute?
a. display
b. get
c. print
d. set
e.
5. Problem 1. The program allows the user to input any name and outputs the text
“Hello, ”, the name that has been input by the user and an exclamation point.
Refer to Figure 2. Rearrange the Pseudocode statements in Figure 1 to get the
correct output.

1 - start
2- input yourName
3- output “Please enter your name:”
4- output “Hello, ”,yourName,“!”
5 - stop

Figure 1 Figure 2

a. 1, 4, 2, 3, 5
b. 1, 3, 2, 4, 5
c. 1, 2, 3, 5, 4
d. 1, 5, 3, 4, 2

Lesson Planning Program Logic by Writing


1 Pseudocode

What’s In

Let us have a quick recap on our last module on Program Development Cycle by
answering these guide questions.

1. What are the seven (7) phases in the Program Development Cycle?
2. Which of these phases you think is the most difficult? Why?
3. When can we say that a program is executable and when will a program be not
executable?

What’s New

Activity 1. Fact or Bluff. Invite one or two members of the family as bluffers. Bluffers
role is to give their own opinion regarding each statement. After stating their opinions,
determine whether each statement is a FACT or a BLUFF. If you answered correctly, the
point is yours. Otherwise, the bluffers will own the point.
(Note: Each statement was adapted from various fact sites/vlogs on the internet.)

2
1. Cows do not have upper front teeth.
2. A diamond will break if you hit it with a hammer.
3. A person can live without food for about a month, but only about a week
without water.
4. Not all our taste buds are on our tongue; about 10% are on the palette and the
cheeks.
5. Toenails grow nearly 4 times faster than fingernails.

Congratulations! You did a nice job.

What is It

In Module 2, one of the most commonly used planning tools is Pseudocode. Pseudocode
is defined as an English – like representation of the logical steps it takes to solve a
problem. Pseudo is a prefix that means false, and to code a program means to write it
using a programming language. Therefore, pseudocode simply means false code, or
statements that seems to be written using a computer programming language but do
not follow all the syntax rules of any specific language. Instead, it follows the Pseudocode
standards as follows:

Pseudocode Standards

1. Programs begin with start and end with stop; these two words are always
aligned.

2. Whenever a module name is used, it is followed by a set of parentheses.

3. Modules begin with the module name and end with return. The module name
and return are always aligned.
4. Each program statement performs one action—for example, input, processing,
or output.

5. Program statements are indented a few spaces more than start or the module
name.

6. Each program statement appears on a single line if possible. When this is not
possible, continuation lines are indented.
7. Program statements begin with lowercase letters.

8. No punctuation is used to end statements.

These standards will be one of the measures in identifying syntax errors in your
Pseudocode programs later.

In writing Pseudocode, preserved English words/terms are used to begin statements


and to indicate the operations to be done. They are as follows:

Preserved Pseudocode
Operation Other terms
English word
START to begin a program BEGIN
STOP to terminate a program END
INPUT to enter data GET, READ
SET to process data using CALCULATE,
mathematical operations COMPUTE
OUTPUT to display the processed data DISPLAY, PRINT,
or information WRITE
Table 1. Preserved Pseudocode English words

3
Pseudocode is a planning tool and not the final code to run using a programming
language. This will serve as a guide for the programmer in writing the codes using a
specific programming language’s syntax.

Notice the third column of Table 1. These terms can also be used alternately with the
words in the first column. Both denote same operation. For the meantime, as beginners,
use the terms in the first column to avoid confusion.

Let us have again the Number – doubling program as an example. Examine each
statement with the help of the labels.

start beginning statement


input operation input anyNumber
set doubledNumber = anyNumber * 2
output operation output doubledNumber
stop ending statement

Figure 1. Parts of Pseudocode Program processing


operation

Figure 1 also shows an error – free Pseudocode program because it followed the
Pseudocode standards and uses the correct preserved Pseudocode word for each
operation.

As stated earlier, mathematical operations will be used to process data. Table 1


presents the Mathematical operations and their corresponding symbols to be used in
processing data.

Mathematical Operation Operator Symbol


Grouping Parentheses ( )
Exponent Caret ^
Multiplication Asterisk *
Division Slash /
Subtraction Minus Sign or Dash -
Assignment Equal Sign =
Table 2. Mathematical Operations

This time let us check if a Pseudocode program is correct or not. With the process of
desk – checking, let us see if the desired output is achieved in the Number – doubling
program.

start
input anyNumber
set doubledNumber = anyNumber * 2
output doubledNumber
stop

Figure 2. Number – doubling Program

In desk – checking, you will need an imaginary monitor to display the outputs,
processor to compute and memory to store input and processed data.

Figure 3. Monitor Figure 4. Memory Figure 5. Processor


4
Initially, while the program is not yet run, all three ( ) devices are empty. Let us start
the program and perform the input statement. Notice the events happening in each
device.

input anyNumber
3

Figure 6. Monitor Figure 7. Memory Figure 8. Processor

In input operation, the computer will let the user enter data. In this case, the user
input the value 3. Once the enter key is pressed on the keyboard, the memory will
store the data using the variable name as identification.

3 anyNumber
3

Figure 9. Monitor Figure 10. Memory Figure 11. Processor

For the processing operation, notice what will happen inside the devices.

set doubledNumber = anyNumber * 2


3 anyNumber doubledNumber doubledNumber = 3 * 2
3 6 doubledNumber = 6

Figure 12. Monitor Figure 13. Memory Figure 14. Processor

In this event, the processor (Figure 14) calculates for the value of variable
doubledNumber by multiplying (*) the entered value 3 by the constant value 2. Thus,
giving value 6 as the result that is assigned to variable doubledNumber (Figure 13).
Notice the use of equal sign (=) as assignment operator. This operator does not equate
the two sides of the operation like mathematics do, but it assigns the value on the right
side to the variable on the left side.

Let us proceed to the next statement.

output doubledNumber
3 anyNumber doubledNumber doubledNumber = 3 * 2
3 6
6 doubledNumber = 6

Figure 15. Monitor Figure 16. Memory Figure 17. Processor

Since output statements display any value a variable holds, Figure 17 shows that the
calculated value assigned to variable doubledNumber is displayed on the monitor
(Figure 15). This also shows if your logic is correct or not. In this case, the number –
doubling program is correct since the goal is to double any input data. The value 3 if
doubled is 6.

Always remember that only the monitor can a user or even a programmer see. Memory
(RAM) and Processor (CPU) are inside the System Unit. We can only interact with these
devices using input (keyboard & mouse) and output (monitor) devices. It is then very
important to visualize how the former two devices work according to the instructions
written using Pseudocode statements.

5
The last statement in the Number – doubling program is stop and this signifies
termination of the program.

What’s More

Activity 2. Fill in the Table. Below is a table that contains the different preserved
Pseudocode terms. Accomplish by filling in the missing items.

Function Other terms

start 1.begin

2. end

input get
3. or read

4. set calculate, compute

output 5.

Activity 3. Fill in the Table. Below table contains the Mathematical operations.
Accomplish by providing the missing items.

Operation Operator Symbol

begin
1. ()
Grouping

2. ^
Caret

Multiplication Asterisk 3. *

4. set Plus sign


+

5. =
Equal sign

6
What I Have Learned

Fill inthe blanks by supplying the correct answer.


1. What is Pseudocode? pseudo literary means ____________.
2. What are the different Pseudocode standards?
3. A _____________________ is a software that translates a high – level language into
machine language and indicates if you have used a programming language
incorrectly.
4. What are the different preserved Pseudocode words/terms?
5. What are the different Mathematical Operations and their corresponding
operators/symbols?

What I Can Do

Activity 4. Plan the Logic. Plan the logic by writing Pseudocode statements of a
program that allows a user to enter two (2) values. The program outputs the
product of the two values.

You may use the necessary variables as follows:

first value – num1


second value – num2
product - numProduct

Assessment

Identification. Read and understand each statement. Identify the item being described
and write your answers on a separate sheet of paper.

_____ 1. It is an English – like representation of the logical steps to solve a problem.


_____ 2. This operator is used to get the product of given values.
_____ 3. It is a preserved Pseudocode word/term to begin a Pseudocode program.
_____ 4. This operation uses equal sign (=) as its operator.
_____ 5. It is a preserved Pseudocode term to process data.

7
References
Bibliography

Joyce Farrell. 2015. Programming Logic and Design Comprehensive Version, Eighth Edition. United
States of America: GEX Publishing Services

For inquiries or feedback, please write or call:

Department of Education – Schools Division Office of Makati City

Gov. Noble St., Brgy. Guadalupe Nuevo


City of Makati, Metropolitan Manila, Philippines 1212

Telefax: (632) 8882-5861 / 8882-5862

Email Address: [email protected]

8
8
Technical-Vocational
Education - ICT
Computer Programming
Quarter 2 – Module 4:
Planning Program Logic by
Drawing Flowcharts
TVE – ICT (Computer Programming) 8
Alternative Delivery Mode
Quarter 2 – Module 4: Planning Program Logic by Drawing Flowcharts
First Edition, 2020

Republic Act 8293, section 176 states that: No copyright shall subsist in any work of the
Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such
agency or office may, among other things, impose as a condition the payment of royalties.

Borrowed materials (i.e., songs, stories, poems, pictures, photos, brand names, trademarks, etc.)
included in this module are owned by their respective copyright holders. Every effort has been
exerted to locate and seek permission to use these materials from their respective copyright
owners. The publisher and authors do not represent nor claim ownership over them.

Published by the Department of Education – Schools Division Office of Makati City


OIC-Schools Division Superintendent: Carleen S. Sedilla CESE
OIC-Assistant Schools Division Superintendent/OIC-Chief, CID: Jay F. Macasieb, DEM, CESE

Development Team of the Module

Writer: Jean T. Tumaneng

Editor: Arlene A. Purisima

Reviewer: Celedonia T. Teneza EdD

Layout Artist: Jean T. Tumaneng

Management Team:

Neil Vincent C. Sandoval


Education Program Supervisor, LRMS

Celedonia T. Teneza EdD


Education Program Supervisor, EPP/TLE/TVL

Printed in the Philippines by the Schools Division Office of Makati City


Through the Support of the City Government of Makati (Local School Board)

Department of Education – Schools Division Office of Makati City

Office Address: Gov. Noble St., Brgy. Guadalupe Nuevo


City of Makati, Metropolitan Manila, Philippines 1212
Telefax: (632) 8882-5861 / 8882 - 5862
E-mail Address: [email protected]

ii
What I Need to Know

Hello, Grade 8 Learners! This module is designed to help you fully understand
how to plan a program logic using Flowcharts and some more basic programming terms.
Feel free to explore each part and accomplish each activity at your own pace.
This module is here to guide you through this lesson. In case you were not able
to follow and understand some instances, you can always go back to that part.
Are you ready? Let us start.
The module is composed of one (1) lesson, namely:
• Lesson 1 – Planning Program Logic by Drawing Flowcharts
After going through this module, you are expected to:
1. define the term Flowchart;
2. recognize the different flowchart shapes;
3. appreciate the advantages of using flowchart in planning a program logic;
4. plan a program logic by drawing flowcharts.

What I Know

Choose the letter of the best answer. Write the chosen letter on a separate sheet of
paper.

1. Next to understanding the problem in the program development cycle is to plan


the logic using various planning tools. Which planning tool helps programmers
to visualize how the statements in a program are interrelated?
a. Flowchart
b. IPO Chart
c. Pseudocode
d. TOE Chart

2. Which of the following shapes is used to show the flow line in a flowchart?

a.

b.

c.

d.

3. What operation uses the shape at the right?


a. decision
b. input/output
c. processing
d. start

4. What shape is used to start and end a flowchart?


a. diamond
b. lozenge shape
c. parallelogram
d. rectangle

1
5. What shape is used to indicate a computation or calculation operation?
a. b.

c. d.

Lesson Planning Program Logic by Drawing


1 Flowchart

What’s In

Let us have a quick recap on our last module on Planning Program Logic by Writing
Pseudocode by answering these guide questions.

1. How is the term Pseudocode defined?


2. Can you enumerate the Pseudocode standards?
3. What are preserved Pseudocode terms/words and their corresponding
functions?

What’s New

Activity 1. DIY Exercise. Invite one member of the family as your trainer. Before
starting the activity, cut the following shapes on a cardboard or any slightly hard paper
and write on them the instructions accordingly. The cut cardboards must be arranged
also in correct order as shown below. To start the activity, have your trainer flash the
cards one by one and you will do as instructed.

1. INHALE – EXHALE 2. WALK ON 3. JUMPING


(8X) PLACE (16X) JACK (16X)

5. IF NO, STRETCH
4. ARE YOU 5. IF YES, WALK TO
BOTH ARMS
THE LEFT (8X), WALK
ENJOYING? FORWARD THEN
TO THE RIGHT (8X)
BACKWARD (16X)

6. INHALE – EXHALE
(8X)

Nice Job! You have got an instant Gym Session.

2
What is It

While some programmers prefer writing Pseudocode to plan program logic due to its
similarity to writing actual codes, others prefer drawing flowcharts to plan program logic
because it allows them to visualize more easily how the program statements will
connect. For beginning programmers, flowcharts are excellent tool to interrelate
program statements. Flowchart is pictorial representation of a Pseudocode.

These are the software that can be used to draw flowchart:

MS
Visual
MS Word Powerpoint MS Visio Pencil
Logic

Figure 1. Software for Drawing Flowcharts

In drawing flowcharts, several geometric shapes are drawn. Each shape contains the
individual statements and are connected with arrows. Table 1 summarizes the geometric
shapes used in drawing flowcharts and are called the flowchart symbols.

GEOMETRIC SHAPE SHAPE NAME OPERATION


Lozenge / Racetrack
shape / Elongated Circle / Terminal (Start and Stop)
Rounded Rectangle

Arrow Flowline

Input / Output
Parallelogram

Rectangle Process

Diamond Decision

Rectangle with Inner


Internal Module Call
Horizontal Line Top

Rectangle with inner


External Module Call
vertical lines on both sides

Table 1. Flowchart Symbols

3
Let us take again the Number – doubling program. on Figure 2, notice how the
Pseudocode statements are presented using Flowchart.

Pseudocode Flowchart

start

input anyNumber
start
input anyNumber
set doubledNumber = anyNumber * 2
set doubledNumber =
output doubledNumber
stop anyNumber * 2

output doubledNumber

stop

Figure 2. Pseudocode and Flowchart of Number – doubling program

Programmers seldom plan a program logic using both tools. You may use Pseudocode
or Flowchart, whichever seems easier and more comfortable for you to use. It is then a
must to understand each tool.

When will flowcharts be likely used rather than Pseudocode?


Let us say, the user wants to double 100 numbers. Look at Figure 3, how the
Pseudocode of the Number – doubling program looks like.

start
input anyNumber
set doubledNumber = anyNumber * 2
output doubledNumber
input anyNumber
set doubledNumber = anyNumber * 2
output doubledNumber
input anyNumber
set doubledNumber = anyNumber * 2
output doubledNumber
input anyNumber
set doubledNumber = anyNumber * 2
output doubledNumber
input anyNumber
set doubledNumber = anyNumber * 2
output doubledNumber
input anyNumber
…and so on for 95 more times

Figure 3. Inefficient representation of a program that doubles 100 numbers

4
This is called repeating instructions. In such case, drawing flowcharts is best to use as
planning tool. Look at the next figure (Figure 3) to see how flowchart offers a better
solution for the problem.

start

input anyNumber

set doubledNumber =
anyNumber * 2

output doubledNumber

Figure 4. Flowchart of infinite number – doubling program

Notice that no statement was repeatedly written like Pseudocode does while producing
same output. Figure 4 shows a solution for repeating instructions. The repetition of
series of steps is called loop. Loops will be discussed more thoroughly on Quarter 4 –
Module 3. Comparing Figure 3 with Figure 4, you would most likely use Flowchart for
repeating instructions.

While Figure 4 solved the inefficiency of Pseudocode in this case, it also introduces
another problem that is a never-ending sequence of instructions. We call this situation
as Infinite Loop. You will learn one way of handling this problem in Module 5.
Desk – checking a flowchart works exactly as desk – checking a Pseudocode program.
With the help of the arrows, you will be guided with the flowline of the program.

5
What’s More

Activity 2. Fill in the Table. Below is a table that contains the flowchart symbols.
Accomplish the by filling in the missing items.

FLOWCHART SYMBOL NAME OF SHAPE OPERATION


1 Terminal

Arrow 2

Diamond 3

4 Parallelogram Input / Output

5 Process

Activity 3. Draw the Flowchart. Draw the flowchart of the Pseudocode program
that allows the user to enter the length and the width of a lot and returns the lot
area.

Pseudocode

start
input anyLength, anyWidth
set lotArea = anyLength * anyWidth
output lotArea
stop

What I Have Learned

Answer the following questions.


1. How do we define the word flowchart.
2. What are the different flowchart symbols and their functions?
3. When is drawing a flowchart the better choice in planning a program logic?
4. What term is described as repetition of instructions?
5. Between Pseudocode and Flowchart, which do you prefer in planning program
logic?

6
What I Can Do

Activity 4. Plan the Logic. Plan the logic by drawing a flowchart statements of a
program that allows users to enter length and width of a rectangle and
calculates the Perimeter using the formula P = 2(Length + Width). The
program displays the Perimeter after.

You may use the necessary variables as follows:

length – anyLength
width – anyWidth
perimeter - lotPerimeter

Assessment

Truth or Lie. Read and understand each statement. Evaluate if the statement is a Truth
or a Lie. Put a check (√) mark on the space provided for Truth statements and cross (x)
mark on Lie statements.

_____ 1. In drawing a flowchart, you use a lozenge shape to represent an input


operation.
_____ 2. In drawing a flowchart, you use a parallelogram to represent a processing
operation
_____ 3. In drawing a flowchart, you use a rectangle to represent the flowline of a
program logic.
_____ 4. A problem that flowchart solves is the repetition of instructions called loop.
_____ 5. Flowchart is the visual representation of pseudocode.

7
References
Bibliography

Joyce Farrell. 2015. Programming Logic and Design Comprehensive Version, Eighth Edition. United
States of America: GEX Publishing Services

For inquiries or feedback, please write or call:

Department of Education – Schools Division Office of Makati City

Gov. Noble St., Brgy. Guadalupe Nuevo


City of Makati, Metropolitan Manila, Philippines 1212

Telefax: (632) 8882-5861 / 8882-5862

Email Address: [email protected]

You might also like