Page 63 - Digicode_AI_class_7
P. 63
4. What is if-then-else condition?
5. Write an ‘if’ condition to display “picnic” if it is Sunday today otherwise display “School”.
Critical Thinking
Flexibility
A. Read the program and colour the boxes.
If (number is 1) then colour Blue 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4
If (number is 2) then colour Green
4 2 2 3 3 1 1 4
If (number is 3) then colour Yellow
4 2 2 3 3 1 1 4
If (number is 4) then colour Purple 4 2 2 1 1 3 3 4
4 2 2 1 1 3 3 4
4 2 2 1 1 4
4 2 2 1 1 3 3 4
4 3 3 4
4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
B. Write the if-then-else condition to check if a number is divisible by 3 or not.
Algorithmic Intelligence 61

