Page 76 - Digicode_AI_class_8
P. 76

Explanation: To print all the natural numbers from 1 to 100, the flow of the program will repeat or
            iterate for each number from 1 to 100. For every single iteration it will check for the condition and
            take the appropriate path. This is how iteration works in programming. It will repeat the block of
            code for multiple times until the specified condition is achieved.

                                                                                 Information Literacy
                   code Quest                                                    Media Literacy



                   Answer the following questions:
                   1.   What is an unexpected problem in your program?



                   2.   Name the situation in which the algorithm needs to make a choice.






                   REFRESH


                   Control structure is a coding construct that is used to decide the flow of a program based on the
                 parameters given to it.
                   Logical operators are the fundamental blocks used to implement a decision-making capability in the code.
                   Logical operators also have precedence which determines how the operations are grouped in the
                 absence of parentheses.
                   A function is a block of code which is made up of a set of steps that result in a single specific action.
                   Function parameters are variables local to the function, taken as input to do a task when the function
                 is called and are part of the definition.
                   Arguments are the values that are passed on to the function received by the function as a parameter.
                   An array is a collection of similar data type variables.
                   Sorting is arranging the numbers either in ascending order (smallest number to largest number) or
                 descending order (largest number to smallest number).
                   A sequence in programming is an ordered set of instructions or tasks.



                                             TeCh Ready





            A.  Tick ( ) the correct option.
                1.  Which of the following can create conditional statements?

                    (i)  IF                                          (ii)  IF-ELSE
                   (iii)  Nested IF-ELSE                             (iv)  All of these

                2.  Which of the following operators negates a condition?

                    (i)  OR                                          (ii)  WHAT
                   (iii)  AND                                        (iv)  NOT



                 74    DigiCode AI-VIII
   71   72   73   74   75   76   77   78   79   80   81