0% found this document useful (0 votes)
36 views14 pages

Las Ict7 Java Q3 Las 2

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)
36 views14 pages

Las Ict7 Java Q3 Las 2

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/ 14

9

Schools Division of Koronadal City

JUNIOR HIGH SCHOOL


ICT 7 – Java
Learning Activity Sheet 2:
Loops

QUARTER 3 WEEK 2
Learning Activity Sheet
Quarter 3 – Activity Sheet 2: Loops
Unang Edisyon, 2023

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.

Inilathala ng Kagawaran ng Edukasyon


Kalihim: Leonor Magtolis Briones
Pangalawang Kalihim: Diosdado M. San Antonio

Learning Activity Sheet Development Team

Writers: Arnold John B. De Vera, James Aldrin S. Estabillo and


Editor: Name
Reviewers: Evelyn C. Frusa PhD, Grace J. Miravalles, Rolex H. Lotilla and Arvin M.
Tejada
Illustrator: Name
Layout Artist: Name
Management Team: Crispin A. Soliven Jr, CESE - Schools Division Superintendent
Levi Butihin - Asst. Schools Division Superintendent
Prima Roullo - CID Chief
Grace J. Miravalles - EPS, EPP/TLE
Evelyn C. Frusa, PhD - Division EPS In Charge of LRMS
Bernardita M. Villano - Division ADM Coordinator
Inilimbag sa Pilipinas ng ________________________

Department of Education – Region XII – Koronadal City Division


Office Address: ____________________________________________
____________________________________________
Telefax: ____________________________________________
E-mail Address: ____________________________________________
9

The Java Program


(TLE_ICTJAVA1 1-12POAD-IIf-i-29)
Specific Objective/s

This Learning Activity Module (LAS) was designed and written with you in mind. It is
here to help you master Java Technology and the Java Programming Language. The
scope of this module permits it to be used in many different learning situations. The
language used recognizes the diverse vocabulary level of students. The lessons are
arranged to follow the standard sequence of the course. But the order in which you
read them can be changed to correspond with the textbook you are now using.
The LAS is divided into one (1) learning outcome, specifically:

• LO1 - Demonstrate knowledge of Java technology and Java


programming;
o 1.7 Demonstrate using Loop Constructs in accordance with
Java framework

After going through this Learning Activity Sheets, you are expected to:

1. Analyze patterns of programming in Java Programming Language;


2. Write simple Java Programs;
3. Compile and execute Java Programs;
4. Compile Java Programs using BlueJ;
5. Execute Java Programs using BlueJ;
6. Debug Java Programs;
7. Analyze problems that can be solved using loops; and
8. Construct programs that use loops and test and run it.
Directions/Instructions

In this Learning Activity Sheet, you will study about Java technology and
Java programming.

Notes to the Students

1. Study the lessons and answer religiously the activities. These will guide you on
what you will learn at the end of this Learning Activity Sheet.

2. Discover what you already know by answering the learning activities.

3. Apply what you have learned in real-life situation.


Activity

Activity 1:

Directions: Create a schedule of your usual activities every Saturday. Use the
table below to answer.

Timeframe Activities/Schedule

stablish process charted. boundaies - the


Procedure

Loops

Loops permit a set of instructions to be repeated until a condition is reached.

For Loop

For loop has three main parts separated by semicolons:

initialization – initial values of variables that will be used in the loop; it is even
possible to declare other variables here that will be used in your loop

test condition – a boolean expression that should be satisfied for the loop to
continue executing the statements within the loop’s scope; as long as the condition
is true, the set of statements within the loop will be repeated

increment/operation – dictates the change in value of the loop control variable


every time the loop is repeated

Syntax:

for (<initialization>; <test condition>; <increment/operation>) {

<statement/s>

Example: Output:

While Loop

Here the condition is at the beginning and the set of instructions inside the loop
will be repeated until this condition becomes false.

Syntax:

while (boolean condition) {

<statement/s>

}
Example: Output:

Do-While Loop

The do-while loop is the only loop which executes at least once. This is due to the
fact that the condition for the loop is located at the last part.

Syntax:

do{

<statement/s>

} while (boolean condition);

Example: Output

Nested Loops

In Java, a nested loop is a loop inside another loop. This means you can have one
loop (inner loop) inside another loop (outer loop).

Example: Output:
? Questions
Activity 2:

Directions: Read and analyze each statement. Write check (/) if the statement is
correct and (x) if otherwise.

_________1. Loops permit a set of instructions to be repeated until a condition is


reached.

_________2. For loop has two main parts.

_________3. Parts of the for loop are separated by a colon.

_________4. Initialization is the part of the for loop where initial values of the
variables are assigned.

_________5. It is impossible to declare variables in the for loop.

_________6. The set of statements within the loop will be repeated as long as the
condition set in the for loop is false.

_________7. The condition in while loop is at the beginning and the set of
instructions inside the loop will be repeated until this condition
becomes false.

_________8. The do-while loop is the only loop which executes statements at least
once.

_________9. The condition in the while loop is located at the last part.

_________10. Nested loop is a loop within a loop.


Activity 3

Directions: Read and analyze the sample Java Code below and provide what is
asked in each item below the code.

________________________ 1. What does this program do?

________________________ 2. What is the initial value of the variable sum?

________________________ 3. What is the loop control variable in this


program?
________________________ 4. How many times will the loop iterate?
________________________ 5. What is the value of i in the first iteration of the
loop?
________________________ 6. What is the value of sum after the loop
completes its execution?
________________________ 7. What will be the output if the loop condition is
changed to i <= 5?
________________________ 8. How would you modify the program to
calculate the sum of the first 20 natural
numbers?
________________________ 9. What happens if you initialize i to 0 instead of
1 in the loop declaration?
________________________ 10. How can you modify the program to
calculate the product of the first 10 natural
numbers instead of their sum?
Activity 4.

Directions: Directions: Write a Java Loop Statement determine that will print even
numbers from 1-15. Write your code in the box including the variable declaration of
num and your chosen number.

Rubrics for scoring


Category 5 points 1 Point No Points
Accuracy and Code is Code is Attempt to
reliability logically incorrect. answer or No
correct, error answer.
free, and
expected to
provide
correct
output.
Closure

What I have learned in this activity?

1. I have learned that_________________________________________________________


__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________

2. I need to know more about_________________________________________________


__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
References

RAMILO, R. V., & PASCO, D. M. (n.d.). COMPUTER HARDWARE SERVICING. K TO


12 - TECHNOLOGY AND LIVELIHOOD EDUCATION.
Blanco, E. (2017, September 12). CSS NC II learning Module. Retrieved June 03,
2020, from https://www.slideshare.net/edmundblanco/css-nc-ii-learningmodule
K to 12 Basic Education Curriculum Technology Livelihood Education Learning
module -Computer hardware servicing
https://kupdf.net/download/common-tools-and-equipment-for-computersystem-
servicing_5a2f023ce2b6f5f679a8c411_pdf
Department of Education, Soccsksargen Region. TLE CSS Quarter 1 Module 5:
Preparing and Interpreting Technical Drawing.
De Jesus Jr. J., et al. (2012). Programming and Databases 2 nd Edition. TechFactors
Inc.
Para sa mga katanungan o puna, sumulat o tumawag sa:

Department of Education – Koronadal City Division

-------------------------------------
-------------------------------------
-------------------------------------

Telefax: -------------------------

Email Address: ------------------------------------


PAHATID – LIHAM

You might also like