Page 77 - Digicode_AI_class_8
P. 77

3.  Which of the following statement does the if-else statement requires?

                    (i)  Evaluation                                  (ii)  Execution

                   (iii)  Else execution block                       (iv)  All of these
                4.  Which of the following is the correct syntax to calculate the square of the number?

                    (i)  sq= x + x                                   (ii)  sq= x - x

                   (iii)  sq= x * x                                  (iv)  sq= x % x
                5.  Which of the following are the values passed on to the function?
                    (i)  Argument                                    (ii)  Parameter

                   (iii)  Function                                   (iv)  Real values

                6.  Which statement best describes arrays?

                    (i)  A data structure that shows a hierarchical behavior.

                    (ii)  Container of objects of similar data types.
                   (iii)  Array is not a data structure.

                   (iv)  Arrays stores elements of different data types.


            B.  State whether these statements are true or false.
                1.  The keyword elif, checks another statement if previous statement is false.

                2.  Relational operator compare the value of two variables.

                3.  If the condition is true, OR will return false and vice-versa.

                4.  A function cannot have more than one parameter.
                5.  An array is an arrangement of objects.

                6.  Sorting is the process of arranging items in a collection.

            C.  Match the following:
                1.  An Array                           a.  Repeat certain lines of code in sequence

                2.  Function                           b.  Real values passed to the function

                3.  Function Parameters                c.  arr = [1, 2, 3, 4, 5, 6];
                4.  Arguments                          d.  Collection of similar data type variables

                5.  Declaration of Array               e.  Variables local to function

            D.  Answer the following questions:
                1.  What are the different types of control structures?




                2.  Write the difference between While loop and For loop.




                                                                           Advanced MakeCode Arcade       75
   72   73   74   75   76   77   78   79   80   81   82