Page 35 - Touchcode_C6_Flipbook
P. 35

Multiply AND                   *=      Multiplies the right operand  b *= a (b *= 10) is
                  assignment operator                    with  the left operand and  equivalent to b = b * a
                                                         assigns the result to the left  (b = 30 * 10) (b=300)
                                                         operand.
                  Divide AND assignment          /=      Divides  the  left  operand  b /= a (b/ = 10) is
                  operator                               with  the  right  operand  and  equivalent to b = b / a
                                                         assigns the result to the left  (b = 30/10) (b=3)
                                                         operand.

                  Floor Divide AND               //=     divides the left operand by  b//=a  (b//  =10)  is
                  assignment operator                    the  right  operand,  rounds  equivalent  to  b=  b//a
                                                         down the result, and assigns  (b=30//10) (b=3)
                                                         it back to the left operand.
                  Modulus AND                   %=       Takes modulus of two  b % = a (b% = 10) is
                  assignment operator                    operands  and  assigns  the  equivalent to b = b % a
                                                         result to the left operand.       (b = 30 % 10) (b=0)
                  Exponentiation AND            **=      raises the left operand to the  b**=  a (b**  = 2) is
                  assignment operator                    power of the right operand  equivalent to b =b**a
                                                         and assigns the result back  (b= 10**2) (b= 1000)
                                                         to the left operand.


                   Coding           uiz  03                                                           Subject Enrichment



                    Give one word answer to the following questions:

                    a.  Add AND assignment operator is denoted by:                        .....................................
                    b.  Divide AND assignment operator is denoted by:                     .....................................




                                                                                                       Critical Thinking
                                                      Coding Task            01


                                To create variable 'a' in MakeCode Arcade and assign it a value of 10

                  To perform the task, follow these steps:

                  Step 1:     Visit the link:  https://arcade.makecode.com/,
                            the following screen appears:


                  Step 2:     Click on 'New Project',       , write the name
                                                                                   Create a variable
                            of your project 'Create a variable', and then click

                            on 'Create'.
                  Step 3:   The following screen appears:


                                                                                 Variables Using  Block Coding   33
   30   31   32   33   34   35   36   37   38   39   40