Page 88 - Trackpad_V2.1_class8
P. 88
d. Which of the following results true if both conditions are true?
(i) AND (ii) OR
(iii) Both (i) and (ii) (iv) None of these
2. Fill in the blanks using the words from the help box.
condition, conditional, else, if
a. Conditional statements in a program instruct the computer to make a decision based on a given
_______________.
b. The statements written after the _______________ condition in a program are executed when the
condition is true.
c. In a program, the statements following _______________ are executed when the condition specified
in the 'if' statement is false.
d. There are two types of loops counting loops and _______________ loops.
3. Think and answer.
a. How do loops help us?
____________________________________________________________________________________
b. Write an if condition to display “We have a match on Sunday” or “No, match on Sunday” based on
whether today is Sunday and if there is a cricket match.
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
c. Write an if condition to display “Exam today” or “No exam on weekend” if it is a weekday today or
your exam.
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
4. Write the output of the following programs:
a.
Repeat 5 times Num1 4 7 87 45 22
{ Num2 7 5 34 32 90
READ Num1 Print
READ Num2
IF Num1 > Num2 THEN
PRINT “Num1 is greater”
ELSE
PRINT “Num2 is greater”
}
86 Trackpad (V2.1)-VIII

