You are on page 1of 4

Republic of the Philippines

Department of Education

Learning Activity Worksheets (LAW)


PROGRAMMING NCIII
Grade 12
NAME: ________________________________________________ SCORE: _______________
GRADE & SECTION: _____________________________________ TEACHER: _____________

LOGICAL OPERATORS
Week 3

ACTIVITY 1 Identification. (10 points)


Directions: Read each item carefully and identify concept/terms on every item. Write
your answers on the space provided.

1. What logical operator results in true if one condition is true?

2. What logical operator results in true if both conditions are true?

3. What operators either change the value of a boolean expression or combine two
boolean expressions?

4. What logical operator reverses the truth of the boolean expression?

5. What is a tale that shows the possible outcomes of two expressions joined by a
logical operator?
LEARNING ACTIVITY WORKSHEETS
Grade 12 – Programming NC III

ACTIVITY 2 Truth Table. (10 points)


Directions: Complete the table by indicating if the result of such a combination is true
or false. Write your answers on the space provided.

Logical Expression Result (true or false)

true && false


true && true
false && true
false && false
true || false
true || true
false || true
false || false
!true
!false

ACTIVITY 3 Logical Expression. (10 points)


Directions: Assume the variables a=2, b=4, c=6. Indicate the results of each of the
following conditions. Write your answers on the space provided.

Logical Expression Result (true or false)


a == 4 || b > 2
6 <= c && a > 3
1 != b && c != 3
a >= -1 || a <= b
!(a > 2)

Q2 - Week 3
MELC: Demonstrate using Decision constructs in accordance with Java framework.
TLE_ICTJAVA11-12POAD-IIf-i-29
(Government Property. Not for sale)

Page 2 of 4
LEARNING ACTIVITY WORKSHEETS
Grade 12 – Programming NC III
ACTIVITY 4 Write an IF Statement. (10 points)
Directions: Write the following IF statements. Write your answers on the space
provided.

1. Write an if statement that displays the message "The number is valid." if the
variable speed is within the range 0 through 200.

2. Write an if-else statement that displays the message "The number is not valid." if
the variable speed is outside the range 0 through 200.

3. Write an if-else statement that displays the message “The number is valid.” if the
variable temperature is within the range 50 through 150.

4. Write an if-else statement that displays the message “The number is not valid.” if
the variable hours is outside the range 0 through 80.

5. Write an if statement that displays the message “Valid number.” if the variable
number is equal 6 or not greater than 3.

Q2 - Week 3
MELC: Demonstrate using Decision constructs in accordance with Java framework.
TLE_ICTJAVA11-12POAD-IIf-i-29
(Government Property. Not for sale)

Page 3 of 4
LEARNING ACTIVITY WORKSHEETS
Grade 12 – Programming NC III
ACTIVITY 5 Short Answer. (15 points)
Direction: Write your answers on the space provided.
1. Define Logical AND operator and explain its truth table.

2. Define Logical OR operator and explain its truth table.

3. Define Logical NOT operator and explain its truth table.

GABRIEL JOSEPH T. BALIUAG


TIII/LPCNSHS – Dona Josefa Campus

Q2 - Week 3
MELC: Demonstrate using Decision constructs in accordance with Java framework.
TLE_ICTJAVA11-12POAD-IIf-i-29
(Government Property. Not for sale)

Page 4 of 4

You might also like