Page 96 - Trackpad_V4.0_C8_Flipbook
P. 96

Recap


                            Conditional statements are used in a program to instruct the computer to make a decision.

                            A loop allows a set of instructions or a block of code to be executed repeatedly.

                            When a loop repeats forever (endlessly), it is called an infinite loop.


                                                 Assess Yourself



                     Choose the correct option.


                      1.  The result of the computer’s decision for a                 will always be either true or false.

                                a. loop                                       b. condition

                                c. Both a and b                               d. None of these

                      2.  A loop is used to execute instructions or a block of code                times.

                                a. two                                        b. three

                                c. multiple                                   d. ten

                      3.  What is an endless loop called?

                                a. Counting loop                              b. Conditional loop

                                c. Infinite loop                              d. None of these

                      4.  Which of the following results true if both conditions are true?

                                a. AND                                        b. OR

                                c. Both a and b                               d. None of these


                     Fill in the blanks with the correct words.


                                                 Hints  condition,  conditional,  else,  if


                      1.   Conditional statements in a program instruct the computer to make a decision based on a given
                                            .
                      2.   The statements written after the                condition in a program are executed when the
                         condition is true.
                      3.   In a program, the statements following               are executed when the condition specified
                         in the 'if' statement is false.
                      4.  There are two types of loops counting loops and                 loops.










                 94     Premium Edition-VIII
   91   92   93   94   95   96   97   98   99   100   101