Page 144 - Computer - 6
P. 144

Help Area

            The Help Area, present to the right of the Editor window, displays detailed information about an
            object, a property, an operation, or an event when you write a program in the Editor window.

            Elements of Small Basic Language
            A programming language consists of some basic elements to construct a program. The elements of
            Small Basic include keywords, constants, variables, operators, statements, and comments.

            Keywords
            A Keyword is a reserved word that has a specific meaning in Small Basic. The Small Basic language
            consists of 14 keywords- Else, ElseIf, EndFor, Endlf, EndSub, EndWhile, For, Goto, If, Step, Sub, Then,
            To, and While.

            Constants
            A Constant is a value that cannot be changed during the execution of a program. Constants in Small
            Basic are of two types:

            (a)  Numeric Constants: These include any numeric value – integer or decimal number, on which
                mathematical operations can be performed. 4, 35.2, and -15.6 are some examples of numeric
                constants.

            (b)  String Constants: These include alphabets, digits, and special characters on which mathematical
                operations cannot be performed. String constants are enclosed within double quotes (“ ”). “A”,
                “ABC54.66” and “Small Basic” are some examples of string constants.
            Variables

            A Variable is a location in the computer’s memory that has a name and stores data temporarily.
            The value of a variable can be changed during the execution of a program. Variables in Small Basic
            are of three types:
            (a)  Numeric variables: These are used to store numeric values.
            (b)  String variables: These are used to store string values.

            (c)  Boolean variables: Boolean variables can store one of the values – True or False. These are
                helpful in making decisions.
            Rules for Naming Variables
            1.  A variable should be given a unique and meaningful name.

            2.  A variable name can include letters, digits, and underscores ( _ ).
            3.  A variable name must start with a letter and should not be any keyword.

            Operators and Expressions
            An Operator is a symbol used to perform certain tasks on variables and constants. Operators in Small
            Basic are of three types - Arithmetic, Relational, and Logical.

            An Expression in a program combines operators and operands (variables and constants). An expression
            with arithmetic operators results in a numeric value. The expression with comparison and logical
            operators result in True or False value.



              142
   139   140   141   142   143   144   145   146   147   148   149