3. What are Variables?
A variable is a named value that changes
its contents while the program runs.
You can think of a
variable like a
bucket. A bucket
those contents can
aVariable change
4. Variable Names
Variables have
unique names that
make sense
Champagne
Bucket
5. What can they Hold?
Variables can hold
anything!
Champagne
Bucket
6. Example of Common Use For
Variables in Programs
Name
Age Count
Champagne
Bucket
Programmers make use of Variables when they know something
is going to change
7. Example of Common Use For
Variables in Programs
What’s the
name of the
current user?
I’m holding
the answer
to that!
Champagne Name
Bucket
ITS DAVE!
8. Data types
Variables have a
I’m the type of data type
Variable that
holds only
Champagne !
Don’t you try
and put
Lemonade in
me!
Champagne
Bucket
12. Declaring Variables in VB
Dim is written All variables
below declaring should be
all variables declared as a
data type
Dim name As String
All variable’s
have a name
13. Declaring Variables in VB
Associating something to the
variable
Dim name As String
name = “dave”
The = symbols links
name to Dave
14. Using Variables in Programs
Module Module1
Sub Main()
Dim name As String
name = "Dave"
Console.WriteLine("hello" & name)
Console.ReadLine()
End Sub
End Module