Professional Documents
Culture Documents
Department of Education
SELECTION/DECISION CONSTRUCTS
Week 1
3. What do you call the operators (<, >, <=, >=, ==, !=) that can be used to form a
Boolean expression?
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.
4. Write an if statement that sets the variable fees to 40 if the boolean variable min
is true.
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'.
10. Write an if-else statement that will display “Pass” if the grade is more than 74.
Otherwise, display “Fail”.
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
3. Why is it good advice to indent all the statements inside a set of braces?
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