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: _____________

SELECTION/DECISION CONSTRUCTS
Week 1

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 is a decision structure that executes a set of statements when a condition
is true?

2. What is a decision structure that executes one set of statements when a


condition is true and another set of statements when the condition is false?

3. What do you call the operators (<, >, <=, >=, ==, !=) that can be used to form a
Boolean expression?

4. What is an expression that evaluates to true or false?

5. What are control statements that allow alternative actions based upon conditions
that are evaluated at run time?
LEARNING ACTIVITY WORKSHEETS
Grade 12 – Programming NC III
ACTIVITY 2 Write an If and If-Else Statement. (20 points)
Directions: Write the following if and if-else statements. Write your answers on the
space provided.
1. Write an if statement that assigns 1 to x when y is equal to 21.

2. Write an if statement that multiplies empRate by 1.5 if hours is more than 40.

3. Write an if statement that assigns 0.1 to commission if sales is greater than or


equal to 20000.

4. Write an if statement that sets the variable fees to 40 if the boolean variable min
is true.

5. Write an if statement that assigns 30 to the variable y and assigns 50 to the


variable z if the variable x is greater than 600.

6. Write an if statement that assigns 1 to the variable b and assigns 2 to the


variable c if the variable a is less than 12.

Q2 - Week 1
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
7. Write an if statement that displays “Hello!” if the variable myCharacter contains
the character 'C'.

8. Write an if-else statement that assigns 30 to the variable y if the variable x is


greater than 200. Otherwise, it should assign 1 to the variable y.

9. Write an if-else statement that assigns 2 to x when y is equal to 200. Otherwise,


it should assign 1 to x.

10. Write an if-else statement that will display “Pass” if the grade is more than 74.
Otherwise, display “Fail”.

ACTIVITY 3 Short Answer. (15 points)


Direction: Write your answers on the space provided.

1. Explain what is meant by the term “conditionally executed”.

Q2 - Week 1
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

2. Explain why a misplaced semicolon can cause an if statement to operate


incorrectly.

3. Why is it good advice to indent all the statements inside a set of braces?

GABRIEL JOSEPH T. BALIUAG


TIII/LPCNSHS – Dona Josefa Campus

Q2 - Week 1
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