Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Figure (1-9) the declaration of the variable (Radius) and constant (Pi) on the class level (Form3)

When you run the program by pressing on F5 to do (Start Debugging), and enter a radius, we get the
output, as shown in figure (1-10).

Figure (1-10) User Interface after using the buttons (‫ )الدائرةمساحة‬and, (‫)الدائرةمحيط‬

Variables are reserved places in computer memory (RAM) declared and determined by its
name and type (Data Type), and its value usually changes during the running of the program and the
variable can take initial value, then value changes during the running of the program, such as: price
of product - the value of the tax - the address of employee etc. .. All these data can be changed.

We use the Command (Dim) to declare a variable in VB.NET language, as shown in the following
syntax:
Dim Variable_Name As Data Type [= Initial Value]
Where
Dim: is the declaration of variables.
Variable Name: is a variable name.
Data Type: is the data type to be stored in the variable.
Initial Value: is the initial value that is stored in the declared variable and this part is optional.

Dim F_Name As String


Code means: the declaration of a variable name as (F_Name) in memory, its type is (String).
Dim Total_Price As Single

11/60

You might also like