Monday, March 30, 2009

Form5 ik : Constants & Variables & Data Type

5 Basic elements in programming.

1. Constant.
2. Variable.
3. Data Type.
4. Operators.
5. Control Structures.

Constants
Constant is a data container that stores information. The value will never change (remains constant) at any time during the course of a program.

Declare is the official term used in programming to announce to the program
the condition of statement in programming.

Variables
Variable is a data container that stores information. The value inside may change at any time during the course of a program.

DATA EXAMPLES FOR DIFFERENT DATA TYPES

Data type determines the type of data a variable can store, for example a number or a character. Examples of data types are integer, double, string and boolean.

Integer
Integer data type contains any whole number value that does not have any fractional part.
This is how we declare an integer type constant in Visual Basic statement.
This is how we declare an integer type variable in Visual Basic statement.

Double
Any number value that may and could contain a fractional part.
This is how we declare a double type constant in Visual Basic statement.

String
Any value that contains a sequence of characters.
This is how we declare string type constant in Visual Basic statement.

Boolean
Boolean type consists either a True or False value. Programmers usually use it to store status.
This is how we declare a boolean type constant in Visual Basic statement.

Labels