7/8
Technology and
Livelihood
Education (TLE)
ICT - PROGRAMMING FOR
ROBOTICS (Exploratory Course)
Week 1
i
Technology and Livelihood Education Grade 8
Self-Learning Module – Programming for Robotics
Quarter 1: Module 1: Week 1
First Edition, 2020
Republic Act 8293 section 176 states that: No copyright shall subsist in
any work of the Government of the Republic 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 of office
may, among other things. Impose as a condition the payment of royalties.
Borrowed materials (i.e., songs, stories, poems, photos, brand names,
trademarks, etc.) included in this book 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.
DEVELOPMENT TEAM OF THE MODULE
Writers : Francis Ben P. Salazar
Editor :
Reviewers :
Illustrator : Mar Onell C. Booc
Layout Artist :
Plagiarism Detector Software : PlagiarismDetector.com
Grammarly Software : CitationMachine.com
Management Team:
Schools Division Superintendent : Dr. Wilfreda D. Bongalos CESO V
Assistant Schools Div. Superintendent : Dr. Marcelita S. Dignos CESO VI
Chief Education Supervisor, CID : Dr. Oliver M. Tuburan
Education Program Supervisor, LRMDS : Mrs. Teresita A. Bandolon
Education Program Supervisor, TLE : Mr. Reynold Q. Velos
Department of Education – Regional Office 7
DepED-Division of Lapu-Lapu CIty
Office Address : B. M. Dimataga Street, Poblacion, Lapu-Lapu City
Telefax : (032) 41-4525
E-mail Address :
[email protected] ii
Property of DepED-Division of Lapu-Lapu City | www.depedlapulapu.net.ph | (032) 340-7354
INTRODUCTORY MESSAGE
For the facilitator:
Welcome to Technology and Livelihood Education (TLE Self-Learning
Module on ICT-Programming for Robotics (Exploratory Course).
This module was collaboratively designed, developed and reviewed by
educators both from public and private institutions to assist you, the teacher
or facilitator in helping the learners meet the standards set by the K to 12
Curriculum while overcoming their personal, social and economic constraints
in schooling.
This learning resource hopes to engage the learners into guided and
independent learning activities at their own pace and time. Furthermore, this
also aims to help learners acquire the needed 21st century skills while taking
into consideration their needs and circumstances.
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.
For the learner:
Welcome to the Technology and Livelihood Education (TLE Self-
Learning Module on ICT-Programming for Robotics (Exploratory Course).
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.
iii
HOW TO USE THE MODULE
Welcome to your modular training in Programming for Robotics
(Exploratory Course). In this module you will have a great deal of
understanding in programming for robotics, and will provide you a fun,
engaging way to learn about the basics in computer science concepts.
This module covers the following:
1. Conditionals in Bee
2. While Loops in Farmer
You must follow the progression of the topics lesson by lesson for easy
understanding.
1st – Answer the Pre-Test.
2nd – Read the given lessons & open the given links for further
references.
3 – Perform the given activity then submit evidences/outputs.
rd
4th – Answer the Post-Test.
Take note, you need to be online in doing the activities in this
module, and do not skip videos in each activity. Now let us start exploring
new things.
iv
Lesson 1.1 – Conditionals in Bee
What I Need to Know
This will give you an idea of the skills or competencies you are expected to
learn in the module.
OBJECTIVES
1. Identify the function of a conditional block.
2. Use the conditional IF block in a program.
3. Display patience in solving puzzles using a combination of looped
sequences and conditionals.
4. Appreciate conditional statements in a program.
DepED-Division of Lapu-Lapu City 5 TLE/TVL
What I Know
This part includes an activity that aims to check what you already know about
the lesson to take. If you get all the answers correctly (100%), you may decide
to skip this module.
Pre-Test 1.1
This is to check what you know about the lesson. Do not open/scan the
lesson while answering. Take the test honestly.
Multiple Choices: Encircle the letter of the correct answer.
1. What do you call to the statements that only run under certain conditions?
A. Conditions B. Conditionals C. Loop D. While Loop
2. Which of the following checks a program to see if it is true before allowing
an action?
A. Conditions B. Until C. Loop D. Repeat
3. Which of the following blocks is an example of a Conditional Block?
A. Move B. Repeat C. Turn D. If
4. Which of the following Conditional Blocks will answer the True or False
question?
A. If B. If/Else C. Repeat D. Repeat/Else
5. What object represents the code of intructions in the hour of code?
A. Block B. Sprite C. Pallete D. Tool
True or False: Write True if the statement is correct, otherwise write False.
______6. Repeat and Repeat/Else are examples of a conditional block.
______7. The will allow the object to move to the cloud and only
get nectar if there is a flower on its path.
______8. This code will make honey at flower and collect nectar
at honeycomb.
______9. and are not Conditionals.
______10. This activity is an example of Conditionals. If you have coins step
forward, if you have bill step backward.
Refer to Answer Key
DepED-Division of Lapu-Lapu City 6 TLE/TVL
What’s In
This is a brief drill or review to help you link the current lesson with the
previous one.
In your previous year, you have been writing code that executes the
same way each time it is run. Today you will be learning and begin to code
with conditionals which functions differently depending on the conditions the
program encounters.
What’s New
In this portion, the new lesson will be introduced to you in various ways; a
story, a song, a poem, a problem opener, an activity or a situation.
Look at the picture above, the clouds with a “?” mark can be a flower
or a honeycomb (dugos). What will the bee do if it is a flower? Or if it is a
honeycomb? (Think for 1 minute for your own answer before proceeding to
the next paragraph.)
DepED-Division of Lapu-Lapu City 7 TLE/TVL
What Is It
This section provides a brief discussion of the lesson. This aims to help you
discover and understand new concepts and skills.
You will be going to use a conditional block. Conditionals are
statements that will only run under certain conditions. Condition is
something a program checks to see if it is true before allowing it to perform.
The if/else blocks will allow for a more flexible program. The bee will
only collect nectar IF there is a flower or make honey IF there is a honeycomb.
You will practice and recognize a connection between if/else blocks and while
loops in this lesson.
What I Have Learned
This includes questions or blank sentence/paragraph to be filled in to process
what you learned from the lesson.
This time you go to your computer/laptop/smartphone and open the
hour of code website (code.org) then follow the following steps below.
1. Create/Log-in to your Code.org account (you can use your gmail or
facebook account).
2. Scroll down under the “My Dashboard” Tab.
3. Input the classroom code given by your teacher.
4. Click the Course your teacher has assigned to you.
5. Select Lesson 11. Conditionals with Bee
6. Finish the assigned course honestly.
What I Can Do
This section provides an activity which will help you transfer your new
knowledge or skill into real life situations or concerns.
Journal Prompts: Write a journal about what you have learned in the
Conditionals with Bee activity. The following questions will be your guide in
DepED-Division of Lapu-Lapu City 8 TLE/TVL
doing your journal. Use the space below or the back portion of this page.
What was today’s lesson all about?
How do you feel about today’s lesson?
What conditionals did you use in your code today?
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.
Assessment
This is a task which aims to evaluate your level of mastery in
achieving the learning competency.
Self-Check 1.1
Multiple Choices: Encircle the letter of the correct answer.
1. What object represents the code of intructions in the hour of code?
A. Block B. Sprite C. Pallete D. Tool
2. Which of the following checks a program to see if it is true before allowing
an action?
A. Conditions B. Until C. Loop D. Repeat
3. Which of the following blocks is an example of a Conditional Block?
A. Move B. Repeat C. Turn D. If
DepED-Division of Lapu-Lapu City 2 TLE/TVL
4. Which of the following Conditional Blocks will answer the True or False
question?
A. If B. If/Else C. Repeat D. Repeat/Else
5. What do you call to the statements that only run under certain conditions?
A. Conditions B. Conditionals C. Loop D. While Loop
True or False: Write True if the statement is correct, otherwise write False.
______6. Repeat and Repeat/Else are examples of a conditional block.
______7. This code will make honey at flower and collect nectar
at honeycomb.
______8. The will allow the object to move to the cloud and only
get nectar if there is a flower on its path.
______9. and are not Conditionals.
______10. This activity is an example of Conditionals. If you have coins step
forward, if you have bill step backward.
Refer to Answer Key
Additional Activities
In this portion, another activity will be given to you to enrich your
knowledge or skill of the lesson learned. This also tends retention of
learned concepts.
Try doing this at home, let your family members line up.
You will be the Caller to give the condition and asks them who meets
the condition to step forward/sideward.
o If you have coins in your pocket, step forward.
o If you have paper bills, step sideward.
DepED-Division of Lapu-Lapu City 3 TLE/TVL
Lesson 1.2 - While Loops in Farmer
What I Need to Know
This will give you an idea of the skills or competencies you are expected to
learn in the module.
OBJECTIVES
1. Distinguish between loops that repeat a fixed number of times and
loops that repeat as long as a condition is true.
2. Use a while loop to create programs.
3. Analyze and solve the given problems with creativity.
4. Collaborate with your partner in the given activity.
DepED-Division of Lapu-Lapu City 4 TLE/TVL
What I Know
This part includes an activity that aims to check what you already know about
the lesson to take. If you get all the answers correctly (100%), you may decide
to skip this module.
Pre-Test 1.2
This is to check what you know about the lesson. Do not open/scan the
lesson while answering. Take the test honestly.
Multiple Choices: Encircle the letter of the correct answer.
1. What block do the action over and over again?
A. Conditionals B. Loop C. Repeat D. While
2. Which block lets you do something over again in a specific number?
A. Conditionals B. Loop C. Repeat D. While Loop
3. What loop continues to repeat while a condition is true?
A. Loop B. Until C. While Loop D. Repeat
4. Which of the following blocks will do something if the condition is true?
A. If B. If/Else C. While D. While/Else
5. Which of the following is the best example of a While Loop?
A. Walking to school early. C. Chatting with your crush.
B. Eating dinner at night. D. Mopping the floor until it’s clean.
True or False: Write True if the statement is correct, otherwise write False.
______6. With this code the farmer/sprite will never stop
removing dirt.
______7. In washing the dishes you scrub the dishes until it is clean, this is
not a good example of a While Loop.
______8. Drinking 3 glasses of water is an example of a While Loop.
______9. Repeat Block and While Loop can not be used at the same time.
______10. Repeat Block and While Loop are examples of a Condition.
Refer to Answer Key
DepED-Division of Lapu-Lapu City 5 TLE/TVL
What’s In
This is a brief drill or review to help you link the current lesson with the
previous one.
Upon reaching this lesson, you should already have plenty of practice
using repeat loops, so now it’s time to mix things up.
What’s New
In this portion, the new lesson will be introduced to you in various ways; a
story, a song, a poem, a problem opener, an activity or a situation.
Look closely at the code above. What will happen after you click “Run”?
A. Nothing will happen.
B. The farmer will never stop removing dirt.
C. The farmer will remove dirt as long as there is a pile, then
stop when the pile is gone.
D. I don't know.
Have you chosen an answer?
What Is It
This section provides a brief discussion of the lesson. This aims to help you
discover and understand new concepts and skills.
As you continue to deepen your knowledge of loops, you will come
DepED-Division of Lapu-Lapu City 6 TLE/TVL
across problems where a command needs to be repeated, but you do not know
how many times it will be repeated. This is where while loops come in.
While loops are loops that continue to repeat commands while a
condition is met. These kinds of loops are used when you don’t know the exact
number of times the commands will repeat but you know what condition
needs to be true in order for the loop to continue repeating. For example in
your What’s New activity above, when you click run, the farmer will remove
dirt as long as there is a pile of sand and will stop when the pile of sand is
gone.
In today’s lesson, you will develop a beginner’s understanding of
condition-based loops and also expand your knowledge of loops in general.
What I Have Learned
This includes questions or blank sentence/paragraph to be filled in to
process what you learned from the lesson.
This time you go to your computer/laptop/smartphone and open the
hour of code website (code.org) then follow the following steps below.
1. Log-in to your Code.org account (you can use your gmail or facebook
account).
2. Scroll down under the “My Dashboard” Tab.
3. Input the classroom code given by your teacher.
4. Click the Course your teacher has assigned to you.
5. Select Lesson 12. While Loops with Farmer
6. You may contact your classmates/friends in this activity.
What I Can Do
This section provides an activity which will help you transfer your new
knowledge or skill into real life situations or concerns.
Journal Prompts: Write a journal about what you have learned in the
Conditionals with Bee activity. The following questions will be your guide in
doing your journal. Use the space below or the back portion of this page.
What was today’s lesson all about?
How do you feel about today’s lesson?
DepED-Division of Lapu-Lapu City 7 TLE/TVL
In your own understanding, what is the difference between a while loop
to a normal repeat loop?
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..
Assessment
This is a task which aims to evaluate your level of mastery in
achieving the learning competency.
Self-Check 1.2
Multiple Choices: Encircle the letter of the correct answer.
1. What block do the action over and over again?
A. Conditionals B. Loop C. Repeat D. While
2. Which block lets you do something over again in a specific number?
A. While Loop B. Repeat C. Loop D. Conditionals
3. What loop continues to repeat while a condition is true?
A. Until B. While Loop C. Repeat D. Loop
4. Which of the following blocks will do something if the condition is true?
A. If B. While C. If/Else D. While/Else
5. Which of the following is the best example of a While Loop?
A. Walking to school early. C. Chatting with your crush.
TLE 7/8 Exploratory - Carpentry 8 DepED-Division of Lapu-Lapu City
B. Mopping the floor until it’s clean. D. Eating dinner at night.
True or False: Write True if the statement is correct, otherwise write False.
______6. With this code the farmer/sprite will remove the dirt
as long as there is a pile, then stop when there’s no more pile.
______7. In washing the dishes you scrub the dishes until it is clean, this is a
good example of a While Loop.
______8. Drinking 3 glasses of water is an example of a Repeat Loop.
______9. Repeat Block and While Loop can be used at the same time.
______10. Repeat Block and While Blocks are examples of a Loops.
Refer to Answer Key
Additional Activities
In this portion, another activity will be given to you to enrich your
knowledge or skill of the lesson learned. This also tends retention of
learned concepts.
Put 1 cup of salt in a plate.
Remove the salt in the plate using a spoon (do this until the plate has
no more salt).
In the given activity above you have used a while loop, you keep on
removing the salt until there is no more salt in the plate, so then you
have finished the code.
TLE 7/8 Exploratory - Carpentry 9 DepED-Division of Lapu-Lapu City