SlideShare uma empresa Scribd logo
1 de 14
VARIABLES
KING OF ALL PROGRAMMING
        CONCEPTS
Variables are . . . .


IMPORTANT
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
Variable Names
                  Variables have
                unique names that
                   make sense




    Champagne
      Bucket
What can they Hold?
                  Variables can hold
                      anything!




      Champagne
        Bucket
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
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!
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
Data Types

            String
           Integer
           Double
            Float
  Champagne Char
    Bucket
           Boolean
Reusable

     The point of
   variables is that
     they can be
    changed and
 reused throughout
    the program
Declaring Variables in VB
 There are 3 parts to declaring a
            variable

Dim name As String
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
Declaring Variables in VB
  Associating something to the
            variable

Dim name As String
name = “dave”
           The = symbols links
             name to Dave
Using Variables in Programs
Module Module1

   Sub Main()

       Dim name As String
       name = "Dave"

       Console.WriteLine("hello" & name)

       Console.ReadLine()


   End Sub

End Module

Mais conteúdo relacionado

Mais procurados (20)

Functions in C
Functions in CFunctions in C
Functions in C
 
Array Of Pointers
Array Of PointersArray Of Pointers
Array Of Pointers
 
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
 
Function
FunctionFunction
Function
 
SQL Join Basic
SQL Join BasicSQL Join Basic
SQL Join Basic
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
 
Python-03| Data types
Python-03| Data typesPython-03| Data types
Python-03| Data types
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
C# Strings
C# StringsC# Strings
C# Strings
 
Data structure stack&queue basics
Data structure stack&queue   basicsData structure stack&queue   basics
Data structure stack&queue basics
 
Introduction to Data Structure
Introduction to Data Structure Introduction to Data Structure
Introduction to Data Structure
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
C++ string
C++ stringC++ string
C++ string
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
arrays in c
arrays in carrays in c
arrays in c
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
C++ Arrays
C++ ArraysC++ Arrays
C++ Arrays
 
EASY UNDERSTANDING OF POINTERS IN C LANGUAGE.pdf
EASY UNDERSTANDING OF POINTERS IN C LANGUAGE.pdfEASY UNDERSTANDING OF POINTERS IN C LANGUAGE.pdf
EASY UNDERSTANDING OF POINTERS IN C LANGUAGE.pdf
 

Destaque

Research Methodology
Research MethodologyResearch Methodology
Research MethodologyAneel Raza
 
Sf Group Presentation
Sf Group PresentationSf Group Presentation
Sf Group Presentationlchetwynd
 
Usuarios del Sistema Operativo
Usuarios del Sistema OperativoUsuarios del Sistema Operativo
Usuarios del Sistema OperativoCristianCf07
 
โรคคอเลสเตอรอล
โรคคอเลสเตอรอลโรคคอเลสเตอรอล
โรคคอเลสเตอรอลK'igasune Mirinchan
 
Melakukan perbaikan peripheral
Melakukan perbaikan peripheralMelakukan perbaikan peripheral
Melakukan perbaikan peripheralregianza
 
Kingdoms of Life, Whittakers System of Organization, Biology Lesson PowerPoint
Kingdoms of Life, Whittakers System of Organization, Biology Lesson PowerPointKingdoms of Life, Whittakers System of Organization, Biology Lesson PowerPoint
Kingdoms of Life, Whittakers System of Organization, Biology Lesson PowerPointwww.sciencepowerpoint.com
 
3 nutrientcycling11
3 nutrientcycling113 nutrientcycling11
3 nutrientcycling11jbgruver
 
особливості реалізації основних положень концепції розвитку психологічної слу...
особливості реалізації основних положень концепції розвитку психологічної слу...особливості реалізації основних положень концепції розвитку психологічної слу...
особливості реалізації основних положень концепції розвитку психологічної слу...punkoff34
 
Психологічна допомога дітям у кризовому стані
Психологічна допомога дітям у кризовому станіПсихологічна допомога дітям у кризовому стані
Психологічна допомога дітям у кризовому станіpunkoff34
 
Experiment 1 scientific investigations in plants
Experiment 1 scientific investigations in plantsExperiment 1 scientific investigations in plants
Experiment 1 scientific investigations in plantsNadine Uy
 
Master SmmUS 2015/2016 - Gestión de comunidades y crisis online
Master SmmUS 2015/2016 - Gestión de comunidades y crisis onlineMaster SmmUS 2015/2016 - Gestión de comunidades y crisis online
Master SmmUS 2015/2016 - Gestión de comunidades y crisis onlineXavi Marcé Vila
 

Destaque (20)

Research Methodology
Research MethodologyResearch Methodology
Research Methodology
 
Presentation2
Presentation2Presentation2
Presentation2
 
Reading in files
Reading in filesReading in files
Reading in files
 
Rounding numbers
Rounding numbersRounding numbers
Rounding numbers
 
AIS clubs
AIS clubsAIS clubs
AIS clubs
 
Presentaci n1 (1)
Presentaci n1 (1)Presentaci n1 (1)
Presentaci n1 (1)
 
Select case
Select caseSelect case
Select case
 
Sf Group Presentation
Sf Group PresentationSf Group Presentation
Sf Group Presentation
 
Usuarios del Sistema Operativo
Usuarios del Sistema OperativoUsuarios del Sistema Operativo
Usuarios del Sistema Operativo
 
If
IfIf
If
 
โรคคอเลสเตอรอล
โรคคอเลสเตอรอลโรคคอเลสเตอรอล
โรคคอเลสเตอรอล
 
Melakukan perbaikan peripheral
Melakukan perbaikan peripheralMelakukan perbaikan peripheral
Melakukan perbaikan peripheral
 
Kingdoms of Life, Whittakers System of Organization, Biology Lesson PowerPoint
Kingdoms of Life, Whittakers System of Organization, Biology Lesson PowerPointKingdoms of Life, Whittakers System of Organization, Biology Lesson PowerPoint
Kingdoms of Life, Whittakers System of Organization, Biology Lesson PowerPoint
 
3 nutrientcycling11
3 nutrientcycling113 nutrientcycling11
3 nutrientcycling11
 
Biogeochemical cycles
Biogeochemical cyclesBiogeochemical cycles
Biogeochemical cycles
 
особливості реалізації основних положень концепції розвитку психологічної слу...
особливості реалізації основних положень концепції розвитку психологічної слу...особливості реалізації основних положень концепції розвитку психологічної слу...
особливості реалізації основних положень концепції розвитку психологічної слу...
 
Savonuk
SavonukSavonuk
Savonuk
 
Психологічна допомога дітям у кризовому стані
Психологічна допомога дітям у кризовому станіПсихологічна допомога дітям у кризовому стані
Психологічна допомога дітям у кризовому стані
 
Experiment 1 scientific investigations in plants
Experiment 1 scientific investigations in plantsExperiment 1 scientific investigations in plants
Experiment 1 scientific investigations in plants
 
Master SmmUS 2015/2016 - Gestión de comunidades y crisis online
Master SmmUS 2015/2016 - Gestión de comunidades y crisis onlineMaster SmmUS 2015/2016 - Gestión de comunidades y crisis online
Master SmmUS 2015/2016 - Gestión de comunidades y crisis online
 

Mais de Peter Andrews (9)

Trimming text
Trimming textTrimming text
Trimming text
 
Splitting up text
Splitting up textSplitting up text
Splitting up text
 
Is numeric
Is numericIs numeric
Is numeric
 
Syntax errors
Syntax errorsSyntax errors
Syntax errors
 
Arrays
ArraysArrays
Arrays
 
Loops
LoopsLoops
Loops
 
Collecting user input
Collecting user inputCollecting user input
Collecting user input
 
Hello world
Hello worldHello world
Hello world
 
Flow charts
Flow chartsFlow charts
Flow charts
 

Último

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Último (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

Variables - The King of All Programming Concepts

  • 1. VARIABLES KING OF ALL PROGRAMMING CONCEPTS
  • 2. Variables are . . . . IMPORTANT
  • 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
  • 9. Data Types String Integer Double Float Champagne Char Bucket Boolean
  • 10. Reusable The point of variables is that they can be changed and reused throughout the program
  • 11. Declaring Variables in VB There are 3 parts to declaring a variable Dim name As String
  • 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