Page 63 - ThinkGPT_V2.1_C7_Flipbook
P. 63
4. What is IF-THEN-ELSE condition?
5. Write an IF condition to print “picnic” if it is Sunday today otherwise print “School”.
Critical Thinking
Flexibility
A. Read the pseducode and colour the boxes.
READ number 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4
IF (number is 1) THEN colour Blue
4 2 2 3 3 1 1 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 1 1 3 3 4
IF (number is 4) THEN colour Purple 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

