Page 69 - Computer Genius Class 07
P. 69

Explanation: To print all the natural num ers  rom 1 to 1    the  o  o  the program  ill 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  or multiple times until the specified condition is achie ed.

                                                                                      Information Literacy
                       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.






                       Let's REFRESH

                       ontrol structure is a coding construct that is used to decide the  o  o  a program  ased 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  unction is a  loc  o  code  hich is made up o  a set o  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 o  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.




                                                       exercise




                 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



                                                                                Advanced MakeCode Arcade      67
   64   65   66   67   68   69   70   71   72   73   74