Page 82 - 2502_Pakistan-kifayat_C-8
P. 82

For example: If it is raining, take an umbrella.

              Start

              Set isRaining = TRUE
              If isRaining = TRUE Then

                  Print "Take an umbrella"

              End

                         Timeline


                         Nesting means putting one block of code inside another.
                         A constant is a value that does not change while the program runs.

                         A variable is used to store information during a program’s execution.
                         Conditional statements are used in programming to make decisions.
                         Loops are used when we need to repeat actions without writing the same code again and again.

                         A REPEAT loop is used to repeat a set of actions a fixed number of times.
                         There are situations that require the use of nested loops and conditions to be solved effectively.






                     Choose the correct option.

                      1.  What is a constant in programming?

                               a.  a changing value                          b.  a fixed value

                               c.  a block                                   d.  a condition used to make decisions

                      2.  Which loop runs endlessly?
                               a.  Repeat                                    b.  Forever

                               c.  While                                     d.  For

                      3.  Which statement is used to make decisions?

                               a.  Variable                                  b.  Constant

                               c.  Condition                                 d.  Sequence

                      4.  What do we call a loop placed inside another loop?
                               a.  Nested loop                               b.  Inner loop

                               c.  Repeat loop                               d.  Forever loop

                      5.  What is true about variables?

                               a.  Their value is fixed                      b.  Their value never changes

                               c.  Their value can change                    d.  They are used for sound


                  80  Premium Edition-VIII
   77   78   79   80   81   82   83   84   85   86   87