QUESTION 1: SECTION B
Variables
A variable is the storage location in memory that is stored by its value. A variable is identified or denoted by a variable name. The variable name is a sequence of one or more letters, digits or underscore.
For example: character _
Rules for defining variable name:
- Variable's name MUST be unique.
- Cannot be more than 31 characters.
- MUST begin with letters.
- NO space in between.
- Can't begin with numbers, symbols, or special characters.
DATA TYPES
- CHARACTER
- Consist of all LETTERS, NUMBERS, and SPECIAL SYMBOLS.
- Surrounded by SINGLE QUOTATION MARK (' ' ).
Example: 'A', 'm', '#', '1', or ' '.
STRING
- LOGICAL VALUES/BOOLEAN
INTEGER
FLOATING POINTS (FLOAT)
DOUBLE
LONG DOUBLE
CONSTANT
ARRAY
- A set of locations in the computer memory that has the same name and contains the same data type.
It is almost the same as variable, but variable has allocated only one location that can store one value at a time. Where else, array can allocate more than one location to store several values at a time.
LONG/SHORT INTEGER
- LONG INTEGER: This data type is used to represent long integer.
- SHORT INTEGER: This data type is used to represent short integer.