You are on page 1of 21

10

Computer
Programming
Quarter II – Module 4:
COMPONENTS OF A COMPUTER PROGRAM

"Designed by macrovector / Freepik"


Computer Programming – Grade 10
Self-Learning Module
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 – Regional Office VIII


Regional Director: Ramir B. Uytico EdD, CESO IV
Assistant Regional Director: Arnulfo M. Balane, CESO V

Development Team of the Module


Writers: Alma Valentino Retorca
Language Editors:
Content Editors: Denis Lebajan Dajotoy
Illustrators:
Layout Artist:
Management Team:
Rosemarie M. Guino, EdD, OIC - Chief, CLMD
Ryan R. Tiu, EdD, EPS, CLMD - Science
Joy B. Bihag, EPS, CLMD - LRMS
Ma. Luz I. Orbe, Chief, CID
Carmen R. Lim, PhD, EPS, CID - Science
Cecilia A. Arga, EPS, CID - LRMS

Printed in the Philippines by ________________________

Department of Education – Regional Office VIII

Office Address: Government Center, Candahug, Palo, Leyte

Telefax: 053 - 3233156


E-mail Address: region8@deped.gov.
Introductory Message
This Self-Learning Module (SLM) is prepared so that you, our dear learners,
can continue your studies and learn while at home. Activities, questions,
directions, exercises, and discussions are carefully stated for you to understand
each lesson.

Each SLM is composed of different parts. Each part shall guide you step-by-
step as you discover and understand the lesson prepared for you.

At the end of each module, you need to answer the test to self-check your
learning. Answer keys are provided for each activity and test. We trust that you will
be honest in using these.

In addition to the material in the main text, Notes to the Teacher are also
provided to our facilitators and parents for strategies and reminders on how they
can best help you on your home-based learning.

Please use this module with care. Do not put unnecessary marks on any
part of this SLM. Use a separate sheet of paper in answering the exercises and
tests. And read the instructions carefully before performing each task.

If you have any questions in using this SLM or any difficulty in answering
the tasks in this module, do not hesitate to consult your teacher or facilitator.

Thank you.

ii
For the learner:

Welcome to the Computer Programming 10 Self–Learning Module 4 on Components


of Computer Program!

The hand is one of the most symbolized part of the human body. It is often used to
depict skill, action, and purpose. Through our hands we may learn, create, and
accomplish. Hence, the hand in this learning resource signifies that you as a
learner is capable and empowered to successfully achieve the relevant
competencies and skills at your own pace and time. Your academic success lies in
your own hands!

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.

This module has the following parts and corresponding icons:

This will give you an idea of the skills or


Explore
competencies you are expected to learn in the
module. A brief drill or review to help you link
the current lesson with the previous one. The
new lesson will also be introduced to you in
various ways such as a story, a song, a poem, a
problem opener, an activity, or a situation.
This section provides a brief discussion of the
Learn
lesson. This aims to help you discover and
understand new concepts and skills.

What’s More This comprises activities for independent


practice to solidify your understanding and
skills of the topic. You may check the answers
to the exercises using the Answer Key at the
end of the module.
This includes questions or blank
Apply sentence/paragraph to be filled into process
what you learned from the lesson.

Assess This is a task which aims to evaluate your level


of mastery in achieving the learning
competency.
This contains answers to all activities in the
Answer Key module.

This contains the learner’s reflection. Learners


Reflect
are encouraged to think about the lessons
particularly the parts that went well (they have
understood) and the parts that were weak (they
have difficulty) and write about it briefly.
Learners can share their thoughts and feeling

iii
about the lessons.

At the end of this module you will also find:


References This is a list of all sources used in
developing this module.
The following are some reminders in using this module:

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

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

iv
v
Explore

Introduction:
This user friendly module will guide in your learning & understanding of the
different parts of a Computer Program. The module will permit you use your
different learning in diverse programming languages. We used the language that is
appropriate for your grade level. The lessons were designed to follow the standard
SLM format.
Have you ever wondered about the ever-growing world? Have you been
fascinated by the massive field of Technology? This introductory module will give
you insights in the diversities in the field of the different parts and components of
computer software. We will explore the different paradigms in Software
Development and engage you to concepts that will enable you to study, utilize and
master any programming language you will like in the future.

After going through this module, you are expected to:


1. identify the parts of a computer program;
2. discuss parts & functions of a computer program;
3. compare common computer program parts in different programming
languages

Pre – Assessment:
You will be challenged to dig deeper into your prior knowledge and previous
experiences about parts of computer program. This Phase will guide you in
assessing yourself by answering questions for you to further explore the basics of
computer programming.

TEST I. Direction: Choose the letter of the correct answer.


1. These are files that define how the Software will run, how to use the Content,
security, performance etc. Without them, the Software on its own is usually
useless.
a. Content c. Logs
b. Configuration files d. body
2. ____are the tables of a database system, the documents for a text editor, the
images and HTML pages of a web-server, the servlets and EJBs of an Application
Server, etc.
a. Configuration files c. Logs
b. Content d. body
3. A program that enables a computer to perform a specific task, as opposed to the
physical components of the system.

Q2_STE_Computer_Programming_ Module 4 Page 1 of 23


a. Hardware c. user
b. software d. both a & b
4. Software that is used to write computer programs.
a. Text editor c. variable
b. compiler d. strings
5. They are also popularly known as end-user programs or even productivity
programs which assist the user in completing various tasks.
a. Malicious software c. Application software
b. system software d. drivers

TEST II. DIRECTION: Fill in the graphic organizers with word synonymous or
associated with Computer Programs.

COMPUTER
PROGRAMS

Q2_STE_Computer_Programming_ Module 4 Page 2 of 23


Learn

In your previous lesson, we studied about character and string data type.
The character data type represents individual or single characters.
Characters comprise a variety of symbols such as the alphabet, the numeral
digits, punctuation, etc. On the other hand, string data type is traditionally a
sequence of characters, either as a literal constant or as variable. When we use
strings in programs, we need to enclose the string between quote marks (“....”).
Now we are going to study about Components of Computer Program.

Direction: Using the given image as clue, arrange the following group of letters to
form a computer programming word.

CLUE JUMBLED LETTERS ANSWER

EARDHE

NOOERATIP

TUNPI

MAPGROR

CEDINIOS

Q2_STE_Computer_Programming_ Module 4 Page 3 of 23


It is necessary to know the exact components of a computer program. It is
important before proceeding to learn more advanced programming codes and
techniques.

Components of Computer Program


A program would have the following components, normally:
1. Headers
These are statements placed above the program code and can be used in the
entire program. Examples are the header files to import package, class or
interface.

2. Program beginning and ending


Every program has an identifiable beginning and an identifiable ending.
These contain specific sets of actions to be performed when the program begins
execution and ends the program. Program starts executing codes at its entry point
like the main method or main function header with its open curly brace and ends
with its corresponding closing brace.

3. Data definitions
These are definitions of the data proposed to be used during the program
execution. Each definition results in the allocation of RAM as required. This is
done by specifying the size and type of values that can be stored in an identifier or
variable.

4. Input operations
These operations bring in data from the outside world into the RAM for
processing. Input or scanner functions of a programming language are used to
take input from the user.

5. Output operations
These operations deliver the processed information to the outside world
using the print functions of a programming language.

6. Computational operations
These operations perform mathematical operations and produce results.

7. Decision making operations


These operations make programmed decisions and control the program flow
with the use of control flow statements of a programming language.

8. Program documentation:
These statements explain the logic of the program statements, which assist
other programmers in maintaining the program. Comments can be used to explain
the parts of a programming code.

9. System calls
These operations call the services provided by the operating system and
utilize them in the program. System calls can be in a form of process control, file
management, device management, information maintenance and communication.

Q2_STE_Computer_Programming_ Module 4 Page 4 of 23


Notes to the Teacher
Kindly check also the similarities and differences of components of other
popular programming languages because there are those with unique
components.

EXAMINE THE FOLLOWING SAMPLE CODES

Sample Java program that automatically add two numbers from the user

Q2_STE_Computer_Programming_ Module 4 Page 5 of 23


Sample C program that automatically add two numbers from the user

Sample Python Program to convert Celsius to Fahrenheit

Sample Java Program to make a directory

Q2_STE_Computer_Programming_ Module 4 Page 6 of 23


Engage

Encircle and label the components of computer program.

Practice 1

Practice 2

Q2_STE_Computer_Programming_ Module 4 Page 7 of 23


Apply

Activity 4.1 Understanding Components of Computer


Program
1. Elaborate the similarities and differences of the components of Computer
Program between the presented programming languages.

2. Did you notice any sequence in the components of computer programs or they
just can come from just anywhere in the program. Support your answer.

Q2_STE_Computer_Programming_ Module 4 Page 8 of 23


Activity 4.2 Build with just few blocks
Children can build anything with just few blocks or bricks. In building a
computer program, do you need all the components? What is the least number of
components can you place to successfully run a simplest program? Explain your
answer.

Assess

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

1. Input operation: bring in data from outside world,


output operation:_________________
A. bring out data from inside world
B. deliver the processed information to the outside world
C. deliver the processed information to the inside world
D. compare the information of the inside

2. Which statements explain the logic of the program statements, which


guide the programmers in maintaining the program?
A. begin
B. start
C. activate
D. Program documentation

Q2_STE_Computer_Programming_ Module 4 Page 9 of 23


3. In computer programming, beginning: ___________,
ending: terminate
A. begin
B. execute
C. trigger
D. start

4. Which group classifies the parts of computer program?

I. Headers, System Calls, Input Operations


II. Computational Operations, Program extension
III. Programs, Decision-making Operations
IV. Data Definitions, Output Operations

A. I & II
B. III & IV
C. II & III
D. I & IV

5. Which of the following does not belong to the group?


I. Output operations deliver the processed information to the
outside world.
II. Headers are statements written on top the program code and
can be used in the end of the program.
III. System calls call the services provided by the operating
software and utilize them in the program.
IV. Decision making operations design programmed decisions
and manage the flow of the program.

A. II & III
B. I & III
C. II & IV
D. III & IV

Fill in the blanks. Direction: Complete the sentence, you may choose a word given
inside the box.

        
RAM Input operations Decision making operations logic
execution header computational operation flow

6. An operation that performs mathematics and produces results is called ________.

7. Program documentation explains the _______ of the program statement which


assists other programmers in maintaining the program.

Q2_STE_Computer_Programming_ Module 4 Page 10 of 23


8. _________ these operations make programmed decisions and control the program
flow.

9. Program beginning and ending contain specific sets of actions to be formed when
the program begins _________________ and ends the program.

10. Input operations bring in data from the outside world into the _______ for
processing.

11-15. On the left of the side of the table below are some of the components
of a program. Write the correct sequence of the components on the right side
of the table.

Sequence of the Components of


Components of a Program
a Program

Program beginning 11.

Documentation 12.

Header 13.

Program ending 14.

Data definition 15.

Q2_STE_Computer_Programming_ Module 4 Page 11 of 23


Reflect

Reflection guide questions / statement..

1. What is the most important thing you learn from this module?
2. What do you want to learn more about components of computer program?
3. Where did you encounter difficulties in this module, and what did you do to deal
with it?

Q2_STE_Computer_Programming_ Module 4 Page 12 of 23


Answer Key

Assess
1. B
2. D LEARN Pre-Assessment
3. B
4. D 1. HEADER Test I.
5. A 2. OPERATION
3. INPUT 1. B
6. Computation
4. PROGRAM 2. B
Operation
5. DECISION 3. B
7. Logic
4. A
8. Decision making
5. C
operations
9. execution
10. RAM Test II.
11. Header
12. Program Beginning Macro, Script, Agent, Trigger,
13. Data Definition Procedure, function, Applet,
14. Documentation Servlet, App, Bot and
15. Program Ending
Routine

Q2_STE_Computer_Programming_ Module 4 Page 13 of 23


References

Chemuturi, M. (2019). Computer Programming for Beginners: A step-by-step


guide. Taylor and Francis Group.
Reflect Icon.

2017. https://pixabay.com/illustrations/idea-icon-bulb-creativity-set-2558678/.

Q2_STE_Computer_Programming_ Module 4 Page 14 of 23


For inquiries or feedback, please write or call:

Department of Education – Regional Office VIII – Curriculum and Learning


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

Government Center, Candahug, Palo, Leyte, 6501

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

Email Address: *region8@deped.gov.ph


*clmd.region8@deped.gov.ph *lrmds.region8@deped.gov.ph

You might also like