Page 72 - modular4.0
P. 72

Chapter Profile























                    10  Type your name.        11  Click on the tick button or press the Enter key.


                  Penguin speaks the name for the number of seconds you have given.


                         VARIABLES



                  A program is a group of commands and instructions that tell the computer to carry
                  out a task. In scratch, a program is called a Script. A Script is made up of a number of

                  blocks. So, the blocks are the commands or instructions that we give to the sprite to
                  perform a task.

                  All the numbers, text, date or pictures that we use in a program are called data. We store
                  this data in the computer memory so that we can get information from it later.

                  This data is stored in variables. It is called variable because it does not have a fixed value,
                  its value changes. For example, in the move block, the variable has a value 10 by default.

                  You can modify this value according to your script.

                  Types of Variables

                  Variables  can  store  numbers  as  well  as  letters.  A  variable  that  stores  numbers  is
                  called a numeric variable. These numbers are used in calculations. Examples are 48, -986,

                  12345, etc.

                  A variable that stores letters in the form of strings or characters is called string variable.
                  A string variable can store names, words, sentences, numbers, and enclosed in quotation
                  marks. For example, “Kavita”, “I am 12 years old”,  “12345”. These variables are not used in

                  calculations.







                70   Modular (Ver. 4.0)-V
   67   68   69   70   71   72   73   74   75   76   77