Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 96 - 2625 PortGPt V2.1
P. 96

    Subject Enrichment
                       Coding Tip!

                       So far you have learnt about the blocks in Makecode. You can
                       also see the code in Python language by clicking on the Python

                       button on top of the window.

                            At a Glance

                            Variable is a packet which is used to store data. These packets can be named, referenced
                            and used to perform various mathematical operations.
                            Scope of a variable is the part of the code in which the declared variable can be used.
                            Every variable in a program is unique and you need to allocate the variable a unique name.

                            Data type identifies the type of data which the declared variable can hold.
                            Integer, Floating-point number, Character, String, Boolean are the common data types.

                            Operator is a symbol which operates on a value assigned to a variable. Example: +,-, *, \.
                            Operand  is a value on which the operator performed operation.
                            Arithmetic operation combines two or more numeric expressions by using  arithmetic
                            operators.

                           Exercise

                      A.  Tick ( ) the correct option.

                          1.  Which of the following denotes the area in which a variable can be used?
                              a.   Boundary                               b.  Vision

                              c.  Scope                                   d.  All of the above

                          2.  Which of the following symbol is used to find the remainder?
                              a.   *                                      b.  +

                              c.   x                                      d.  %

                          3.  What is the alternative of y=y-9?
                              a.  y=x-9                                   b.  y+=9

                              c.  y-=9                                    d.  x=-9

                          4.  Which of the following has the same meaning as X++?
                              a.  X=X+1                                   b.  X=+2
                              c.  y-=4                                    d.  X=x-6

                      94    Premium Edition-VI

| 91 92 93 94 95 96 97 98 99 100 101 |