You are on page 1of 4

Republic of the Philippines

Department of Education
Division of City of Bogo
City of Bogo Science and Arts Academy

DETAILED LESSON PLAN

Learning Area:
DLP No.: Grade Level: Quarter: Duration:
Computer
DLP_4.1 Lec 11 4th 2 HOURS
Programming(Java)
Learning LO 1.7 Code:
Competencies: Demonstrate using Loop Constructs in accordance with Java
TLE_ICTJAVA11-
Framework
12POAD-IIf-i-29
Key Concepts/
Principles and concepts in demonstrating knowledge of Java technology and Java programming
Understanding to language, and performing object-oriented analysis and design
Develop:
OBJECTIVES
Knowledge Identify the parts of a While Loop
Skills Draw flowchart to illustrate the flow of While Loops
Attitudes Collaborate with peers
Values Appreciate how concepts of Loops are used by Java Compilers to efficiently compile and execute programs.
CONTENT
Java Loop Control (While Loop)
(Flowchart and Code)
LEARNING RESOURCES
LCD Projector, Programming Notebook, Board and chalk, Activity Materials (construction paper cuts (with different
colors), envelopes, Instruction sheets)
PROCEDURES
Introductory Activity (5 mins)
Prayer
Checking of Attendance
Introduction
Activity (20 mins)
. Activity Instructions: (20 mins)
1. Have students get into groups of 4-5.
2. Pass out the first of the Instruction sheets (Part 1). Have the students begin part 1 - which will select a team lead and set up for Part 2. When
the students finish Part 1, it will instruct the group to send the team lead to show you part 1.
Instruction Sheet Part 1
Please follow the directions as stated. Make sure you do each step and read carefully.
1. In a one-fourth (1/4) piece of paper, write down each team member’s first name.
2. IF the team number has an even number of people, arrange the names in ascending order,
ELSE arrange the names in descending order.
3. Select the first name of the list to be the team leader. Put an asterisk (*) beside the team leader’s name.
4. Double check you followed the directions above.
5. Let the Team Leader pass the paper to your teacher.
3. For each team lead that shows you a correct part 1, give them a Part 2 instruction sheet and one envelope with
paper cuts inside. Have the students begin Part 2.
Instruction Sheet Part 2
Please follow the directions as stated. Make sure you do each step and read carefully.
1. Let the Team Lead be the “artista”.
2. The “artista” should draw a piece of paper from the envelope.
3. IF the paper’s color == “Red”, Go to Step #4
ELSE, Go back to the list of names and let the person next to the current artista’s name be the “artista” this time . Go to Step #2.
* Keep track of your number of passes (how many times you go back to Step #2).
4. Answer the following questions: Write your answers at the back of your list.
a. How many passes did you make of step #2?
b. How is this number related to the number of items that had to be drawn before the red paper was found?
Analysis (10 mins)
After completing the Part 2,
1. Have an open discussion about the activity. Discuss their answers of the questions in the activity.
2. Show the students the possible flowcharts for Part 1 and Part 2.

Part 1 Flowchart Part 2 Flowchart

START START

String name1=”Wilfred”, String name1=”Jaymar”;


name2=”Jaymar”, name2=”Kyle”;
name3=”Kyle”, name3=”Wilfred”,
leader; leader=name1,
int num=3; artista=leader,
Arrange names in paper;
Ascending order:
num is Even
T name1=”Jaymar”;
Input/draw
name2=”Kyle”;
paper
name3=”Wilfred”;
F
F Answer questions;
Arrange names in While
Descending order: paper!=”red”
name1=”Wilfred”; leader=name1;
name2=”Kyle”; T
name3=”Jaymar”; artista = next person to current artista;
STOP
STOP
Input/draw
paper

Abstraction (25 mins)


Discuss Java Loop Control

There may be a situation when we need to execute a block of code several number of times and is often
referred to as a loop.

Java has very flexible three looping mechanisms. You can use one of the following three loops:
while Loop
do...while Loop
for Loop

Parts of While Loop


while keyword
Boolean (Condition)
Statement
Update of Conditional Variable

Ask the students to print their name 5 times on screen. Explain why not using loop is a burden to the compiler. Show the correct way of doing it using while loop
through flowchart and code..

START

int times=1;

F
While
times<=5
STOP

T
Output
“Juan”

times++;

Teach the students how to trace loops.


Application (30 mins)
Give the students some situations. Let them create a flowchart for each given situations.
#1 Display your name and age on screen 3 times
#2 Let the user input any number. IF the number inputted is 0, terminate the program; ELSE keep asking for number inputs.

Let them find a partner. The partners should exchange their notebooks, checks for errors, and gives comments.
Call for representatives to answer the given the situations. This is boardwork.
Assessment (30 mins)
On the, Programming Notebook, draw a Flowchart for the following situation:
A Java program should ask for a user’s name and how many times should his/her name be displayed. If the user inputs 3, the user’’s name should
be displayed 3 times. The program should loop by asking the user if he/she wants to continue testing the program, 0 – NO, 1 - YES. The following is
the sample output.
Name: Juan
How many times?: 3
Juan
Juan
Juan
Do you want to continue?[0-NO, 1-YES]: 1
How many times?: 5
Juan
Juan
Juan
Juan
Juan
Do you want to continue?[0-NO, 1-YES]: 0
Press any key to continue...

This activity is good for 30 minutes. Once done, let them exchange with their seatmate for checking. They have to evaluate each other’s work.

Assignment
Reinforcing / Draw the flow chart and convert it to Java code:
strengthening the
day’s lesson Create a Flow Chart of the Java Program that accepts an integer and checks if the integer is odd or
even. The program will also prompt the user if he/she wants to input another integer, y – YES, and
n – NO.
The program stops if the user chooses n.
Below is the sample output:

Input an integer: 7
ODD
Do you want to continue?[y-YES, n-NO]: y
Input an integer: 4
EVEN
Do you want to continue?[y-YES, n-NO]: y
Input an integer: 10
EVEN
Do you want to continue?[y-YES, n-NO]: n
Press any key to continue...

Enhancing /
improving the day’s
lesson
Preparing for the
new lesson
Concluding Activity
In writing programs, the programmer should always act as a compiler, debugs errors, and traces for output.
REMARKS
REFLECTIONS
A. No. of learners who earned 80% in the
evaluation.
B. No. of learners who require additional
activities for remediation.
C. Did the remedial lessons work? No. of
learners who have caught up with the lesson.
D. No. of learners who continue to require
remediation.
E. Which of my learning strategies worked
well? Why did this work?
F. What difficulties did I encounter which my
principal or supervisor can help me solve?
G. What innovation or localized materials did
I use/discover which I wish to share with
other teachers?
H. No. of learners who earned 80% in the
evaluation.
I. No. of learners who require additional
activities for remediation
J. Did the remedial lessons work? No. of
learners who have caught up with the lesson.

Name: Jane F. Moraca School: City of Bogo Science and Arts Academy
Position / Designation: Teacher I Division: City of Bogo
Contact Nos.: 09362670250 Email Address: janemoraca@gmail.com

You might also like