SlideShare a Scribd company logo
Visual Programming
 A visual programming
language (VPL) is any programming
language that lets users create
programs by manipulating program
elements graphically rather than by
specifying them textually.
A VPL allows programming with
visual expressions, spatial
arrangements of text and graphic
symbols, used either as elements
of syntax or secondary notation.
The Basics: How Programming
Works
 :How a programming language
works, along with basic terminology.
Representing Words, Numbers,
and Values with Variables
 :How variables store values and
represent information, along with
how to use variables.
On its own, a computer isn't very smart.
A computer is essentially just a big
bunch of small electronic switches that
are either on or off. By setting different
combinations of these switches, you can
make the computer do something:
 for example, display something on the
screen or make a sound. That's what
programming is at its most basic—telling
a computer what to do.
s
 A programming language acts as a
translator between you and the computer.
Rather than learning the computer's native
language (known as machine language), you
can use a programming language to instruct
the computer in a way that is easier to learn
and understand.
What is a Programming
Language?
A programming language acts as a translator
between you and the computer. Rather than learning the
computer's native language (known as machine language), you
can use a programming language to instruct the computer in a
way that is easier to learn and understand.
A specialized program known as a compiler takes the
instructions written in the programming language and converts
them to machine language. This means that as a Visual Basic
programmer, you don't have to understand what the computer
is doing or how it does it. You just have to understand how the
Visual Basic programming language works.
The language you write and speak has structure:
for example, a book has chapters with paragraphs that
contain sentences consisting of words. Programs written
in Visual Basic also have a structure: modules are like
chapters, procedures are like paragraphs, and lines of
code are like sentences.
When you speak or write, you use different
categories of words, such as nouns or verbs. Each
category is used according to a defined set of rules. In
many ways, Visual Basic is much like the language that
you use every day. Visual Basic also has rules that define
how categories of words, known as programming
elements, are used to write programs.
Written and spoken language also has
rules, or syntax, that defines the order of words
in a sentence. Visual Basic also has syntax—at
first it may look strange, but it is actually very
simple. For example, to state "The maximum
speed of my car is 55", you would write:
Car.Speed.Maximum = 55
Variables are an important concept in computer
programming. A variable is a letter or name that can store a
value. When you create computer programs, you can use
variables to store numbers, such as the height of a building,
or words, such as a person's name. Simply put, you can use
variables to represent any kind of information your program
needs.
There are three steps to using a variable:
Declare the variable. Tell the program the
name and kind of variable you want to use.
Assign the variable. Give the variable a
value to hold.
Use the variable. Retrieve the value held in
the variable and use it in your program.
Declaring a Variable
When you declare a variable, you have to
decide what to name it and what data type to
assign to it. You can name the variable anything
that you want, as long as the name starts with a
letter or an underscore. When you use a name
that describes what the variable is holding, your
code is easier to read. For example, a variable
that tracks the number of pieces of candy in a
jar could be named totalCandy
You declare a variable using the Dim and As keywords, as
shown here.
This line of code tells the program that you want to
use a variable named aNumber, and that you want it to
be a variable that stores whole numbers (the Integer data
type).
Because aNumber is an Integer, it can store only
whole numbers. If you had wanted to store 42.5, for
example, you would have used the Double data type. And
if you wanted to store a word, you'd use a data type
called a String. One other data type worth mentioning at
this point is Boolean, which can store a True or False
value.
VB
Dim aNumber As Integer
Here are more examples of how to declare variables.
Note:
You can create a local variable without declaring the type of the
variable by using local type inference. When you use local type
inference, the type of the variable is determined by the value that is
assigned to it. For more information, see Local Type Inference.
VB
Dim aDouble As Double
Dim aName As String
Dim YesOrNo As Boolean
You assign a value to your variable with the =
sign, which is sometimes called the assignment
operator, as shown in the following example.
This line of code takes the value 42 and stores it in
the previously declared variable named aNumber.
VB
aNumber = 42
Declaring and Assigning Variables
with a Default Value
As shown earlier, you can declare a
variable on one line of code, and then later
assign the value on another line. This can cause
an error if you try to use the variable before
assigning it a value.
For that reason, it is a better idea to
declare and assign variables on a single line.
Even if you don't yet know what value the
variable will hold, you can assign a default value.
The code for declaring and assigning the same
variables shown earlier would look like the
following.
VB
Dim aDouble As Double = 0
Dim aName As String = "default string"
Dim YesOrNo As Boolean = True
Try it!
In this exercise, you will write a short program that creates
four variables, assigns them values, and then displays each value in
a window called a message box. Let's begin by creating the project
where the code will be stored.
To create the project
1. If it is not already open, open Visual Basic from the
Windows Start menu.
2. On the File menu, click New Project.
3. In the New Project dialog box on the Templates
pane, click Windows Forms Application.
4. In the Name box, type Variables and then click OK.
Visual Basic will create the files for your program and open the
Form Designer.
Next, you'll create the variables.
To create variables and display their values
1.Double-click the form to open the Code Editor.
The Code Editor opens to a section of code called Form1_Load. This
section of code is an event handler, which is also referred to as a procedure.
The code that you write in this procedure is the instructions that will be
performed when the form is first loaded into memory.
2. In the Form1_Load procedure, type the following code.
VB
Dim anInteger As Integer = 42
Dim aSingle As Single = 39.345677653
Dim aString As String = "I like candy"
Dim aBoolean As Boolean = True
 This code declares four variables and assigns their default values. The four
variables are an Integer, a Single, a String, and a Boolean.
Tip: As you typed the code, you may have noticed that after you typed As, a list
of words appeared underneath the cursor. This feature is called IntelliSense. It
enables you to just type the first few letters of a word until the word is selected
in the list. Once the word is selected, you can press the TAB key to finish the
word.
3. Beneath the code you wrote in the previous step, type the following.
 This code tells the program to display each value that you assigned in the previous
step in a new window, using the MsgBox function.
4. Press F5 to run your program.
Click OK for each message box as it appears. Note that the value of each
variable is displayed in turn. You can close the form by clicking the x in the upper-right
corner of the form. After the program has finished, you can go back and change the
values that are assigned in the code—you'll see that the new values are displayed the
next time that you run the program.
VB
MsgBox(anInteger)
MsgBox(aSingle)
MsgBox(aString)
MsgBox(aBoolean)
Note:Whenever you represent actual text in a program, you must enclose it in
quotation marks (""). This tells the program to interpret the text as actual text
instead of as a variable name. When you assign a Boolean variable a value of True or
False, you do not enclose the word in quotation marks, because True and False are
Visual Basic keywords with special meanings of their own.
Visual Programming
Ad

More Related Content

What's hot (20)

Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
TMARAGATHAM
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
OpenSource Technologies Pvt. Ltd.
 
System programming
System programmingSystem programming
System programming
jayashri kolekar
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
Ravi Kant Sahu
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compiler
Iffat Anjum
 
Procedures functions structures in VB.Net
Procedures  functions  structures in VB.NetProcedures  functions  structures in VB.Net
Procedures functions structures in VB.Net
tjunicornfx
 
Exception handling in python
Exception handling in pythonException handling in python
Exception handling in python
baabtra.com - No. 1 supplier of quality freshers
 
Compilers
CompilersCompilers
Compilers
Bense Tony
 
Python introduction
Python introductionPython introduction
Python introduction
Jignesh Kariya
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
daxesh chauhan
 
introduction to visual basic PPT.pptx
introduction to visual basic PPT.pptxintroduction to visual basic PPT.pptx
introduction to visual basic PPT.pptx
classall
 
java interface and packages
java interface and packagesjava interface and packages
java interface and packages
VINOTH R
 
Function in C program
Function in C programFunction in C program
Function in C program
Nurul Zakiah Zamri Tan
 
Modular programming
Modular programmingModular programming
Modular programming
Mohanlal Sukhadia University (MLSU)
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
narmadhakin
 
VB.net
VB.netVB.net
VB.net
PallaviKadam
 
Introduction to Compiler design
Introduction to Compiler design Introduction to Compiler design
Introduction to Compiler design
Dr. C.V. Suresh Babu
 
OOP java
OOP javaOOP java
OOP java
xball977
 
ASP.NET Basics
ASP.NET Basics ASP.NET Basics
ASP.NET Basics
baabtra.com - No. 1 supplier of quality freshers
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
Ritu Ranjan Shrivastwa
 

Viewers also liked (20)

Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
Roger Argarin
 
Visual programming
Visual programmingVisual programming
Visual programming
Aswinraj Manickam
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
MuralirajSanjeev
 
Visual programming lab
Visual programming labVisual programming lab
Visual programming lab
Soumya Behera
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
Ranjuma Shubhangi
 
Specification of a Visual Programming Language by Example
Specification of a Visual Programming Language by ExampleSpecification of a Visual Programming Language by Example
Specification of a Visual Programming Language by Example
Maximilian Fellner
 
Visual programming
Visual programmingVisual programming
Visual programming
Muhammad Bilal Tariq
 
Visula C# Programming Lecture 1
Visula C# Programming Lecture 1Visula C# Programming Lecture 1
Visula C# Programming Lecture 1
Abou Bakr Ashraf
 
Chapter03 Ppt
Chapter03 PptChapter03 Ppt
Chapter03 Ppt
Osama Yaseen
 
Microsoft visual basic 6
Microsoft visual basic 6Microsoft visual basic 6
Microsoft visual basic 6
Penang, Malaysia
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computer
simran153
 
Visual studio .net c# study guide
Visual studio .net c# study guideVisual studio .net c# study guide
Visual studio .net c# study guide
root12345
 
Visula C# Programming Lecture 5
Visula C# Programming Lecture 5Visula C# Programming Lecture 5
Visula C# Programming Lecture 5
Abou Bakr Ashraf
 
Интернет: Основни појмови
Интернет: Основни појмовиИнтернет: Основни појмови
Интернет: Основни појмови
ОШ ХРШ
 
Visula C# Programming Lecture 3
Visula C# Programming Lecture 3Visula C# Programming Lecture 3
Visula C# Programming Lecture 3
Abou Bakr Ashraf
 
Visual basics Express Project
Visual basics Express ProjectVisual basics Express Project
Visual basics Express Project
Iftikhar Ahmed
 
Visual basic 6
Visual basic 6Visual basic 6
Visual basic 6
Jenny Godoy Maldonado
 
Introduction to Bonsai
Introduction to BonsaiIntroduction to Bonsai
Introduction to Bonsai
Edward Gumnick
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
Aarti P
 
visual basic 6.0
visual basic 6.0visual basic 6.0
visual basic 6.0
lesly53
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
Roger Argarin
 
Visual programming lab
Visual programming labVisual programming lab
Visual programming lab
Soumya Behera
 
Specification of a Visual Programming Language by Example
Specification of a Visual Programming Language by ExampleSpecification of a Visual Programming Language by Example
Specification of a Visual Programming Language by Example
Maximilian Fellner
 
Visula C# Programming Lecture 1
Visula C# Programming Lecture 1Visula C# Programming Lecture 1
Visula C# Programming Lecture 1
Abou Bakr Ashraf
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computer
simran153
 
Visual studio .net c# study guide
Visual studio .net c# study guideVisual studio .net c# study guide
Visual studio .net c# study guide
root12345
 
Visula C# Programming Lecture 5
Visula C# Programming Lecture 5Visula C# Programming Lecture 5
Visula C# Programming Lecture 5
Abou Bakr Ashraf
 
Интернет: Основни појмови
Интернет: Основни појмовиИнтернет: Основни појмови
Интернет: Основни појмови
ОШ ХРШ
 
Visula C# Programming Lecture 3
Visula C# Programming Lecture 3Visula C# Programming Lecture 3
Visula C# Programming Lecture 3
Abou Bakr Ashraf
 
Visual basics Express Project
Visual basics Express ProjectVisual basics Express Project
Visual basics Express Project
Iftikhar Ahmed
 
Introduction to Bonsai
Introduction to BonsaiIntroduction to Bonsai
Introduction to Bonsai
Edward Gumnick
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
Aarti P
 
visual basic 6.0
visual basic 6.0visual basic 6.0
visual basic 6.0
lesly53
 
Ad

Similar to Visual Programming (20)

Chapter 2- Prog101.ppt
Chapter 2- Prog101.pptChapter 2- Prog101.ppt
Chapter 2- Prog101.ppt
JosephObadiahTuray
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programming
Hamad Odhabi
 
Visual basic
Visual basicVisual basic
Visual basic
pavishkumarsingh
 
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1ILearn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
livecoding.tv
 
Vb introduction.
Vb introduction.Vb introduction.
Vb introduction.
sagaroceanic11
 
classVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxclassVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptx
ssusere336f4
 
classVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxclassVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptx
MaaReddySanjiv
 
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGEINTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
RathnaM16
 
Ms vb
Ms vbMs vb
Ms vb
sirjade4
 
Programming concepts By ZAK
Programming concepts By ZAKProgramming concepts By ZAK
Programming concepts By ZAK
Tabsheer Hasan
 
Ppt on visual basics
Ppt on visual basicsPpt on visual basics
Ppt on visual basics
younganand
 
01 Database Management (re-uploaded)
01 Database Management (re-uploaded)01 Database Management (re-uploaded)
01 Database Management (re-uploaded)
bluejayjunior
 
programming.ppt
programming.pptprogramming.ppt
programming.ppt
AdrianVANTOPINA
 
Java script basic
Java script basicJava script basic
Java script basic
Ravi Bhadauria
 
Introduction to Visual Basic
Introduction to Visual Basic Introduction to Visual Basic
Introduction to Visual Basic
Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU
 
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
wabii3179com
 
App Inventor : Getting Started Guide
App Inventor : Getting Started GuideApp Inventor : Getting Started Guide
App Inventor : Getting Started Guide
Vasilis Drimtzias
 
Tugas testing
Tugas testingTugas testing
Tugas testing
Astrid yolanda
 
Getting started with the visual basic editor
Getting started with the visual basic editorGetting started with the visual basic editor
Getting started with the visual basic editor
putiadetiara
 
Introduction to Programming Fundamentals 3.pdf
Introduction to Programming Fundamentals 3.pdfIntroduction to Programming Fundamentals 3.pdf
Introduction to Programming Fundamentals 3.pdf
AbrehamKassa
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programming
Hamad Odhabi
 
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1ILearn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
livecoding.tv
 
classVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxclassVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptx
ssusere336f4
 
classVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxclassVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptx
MaaReddySanjiv
 
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGEINTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
RathnaM16
 
Programming concepts By ZAK
Programming concepts By ZAKProgramming concepts By ZAK
Programming concepts By ZAK
Tabsheer Hasan
 
Ppt on visual basics
Ppt on visual basicsPpt on visual basics
Ppt on visual basics
younganand
 
01 Database Management (re-uploaded)
01 Database Management (re-uploaded)01 Database Management (re-uploaded)
01 Database Management (re-uploaded)
bluejayjunior
 
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
wabii3179com
 
App Inventor : Getting Started Guide
App Inventor : Getting Started GuideApp Inventor : Getting Started Guide
App Inventor : Getting Started Guide
Vasilis Drimtzias
 
Getting started with the visual basic editor
Getting started with the visual basic editorGetting started with the visual basic editor
Getting started with the visual basic editor
putiadetiara
 
Introduction to Programming Fundamentals 3.pdf
Introduction to Programming Fundamentals 3.pdfIntroduction to Programming Fundamentals 3.pdf
Introduction to Programming Fundamentals 3.pdf
AbrehamKassa
 
Ad

Recently uploaded (20)

pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 

Visual Programming

  • 2.  A visual programming language (VPL) is any programming language that lets users create programs by manipulating program elements graphically rather than by specifying them textually. A VPL allows programming with visual expressions, spatial arrangements of text and graphic symbols, used either as elements of syntax or secondary notation.
  • 3. The Basics: How Programming Works  :How a programming language works, along with basic terminology. Representing Words, Numbers, and Values with Variables  :How variables store values and represent information, along with how to use variables.
  • 4. On its own, a computer isn't very smart. A computer is essentially just a big bunch of small electronic switches that are either on or off. By setting different combinations of these switches, you can make the computer do something:  for example, display something on the screen or make a sound. That's what programming is at its most basic—telling a computer what to do.
  • 5. s  A programming language acts as a translator between you and the computer. Rather than learning the computer's native language (known as machine language), you can use a programming language to instruct the computer in a way that is easier to learn and understand.
  • 6. What is a Programming Language? A programming language acts as a translator between you and the computer. Rather than learning the computer's native language (known as machine language), you can use a programming language to instruct the computer in a way that is easier to learn and understand. A specialized program known as a compiler takes the instructions written in the programming language and converts them to machine language. This means that as a Visual Basic programmer, you don't have to understand what the computer is doing or how it does it. You just have to understand how the Visual Basic programming language works.
  • 7. The language you write and speak has structure: for example, a book has chapters with paragraphs that contain sentences consisting of words. Programs written in Visual Basic also have a structure: modules are like chapters, procedures are like paragraphs, and lines of code are like sentences. When you speak or write, you use different categories of words, such as nouns or verbs. Each category is used according to a defined set of rules. In many ways, Visual Basic is much like the language that you use every day. Visual Basic also has rules that define how categories of words, known as programming elements, are used to write programs.
  • 8. Written and spoken language also has rules, or syntax, that defines the order of words in a sentence. Visual Basic also has syntax—at first it may look strange, but it is actually very simple. For example, to state "The maximum speed of my car is 55", you would write: Car.Speed.Maximum = 55
  • 9. Variables are an important concept in computer programming. A variable is a letter or name that can store a value. When you create computer programs, you can use variables to store numbers, such as the height of a building, or words, such as a person's name. Simply put, you can use variables to represent any kind of information your program needs.
  • 10. There are three steps to using a variable: Declare the variable. Tell the program the name and kind of variable you want to use. Assign the variable. Give the variable a value to hold. Use the variable. Retrieve the value held in the variable and use it in your program.
  • 11. Declaring a Variable When you declare a variable, you have to decide what to name it and what data type to assign to it. You can name the variable anything that you want, as long as the name starts with a letter or an underscore. When you use a name that describes what the variable is holding, your code is easier to read. For example, a variable that tracks the number of pieces of candy in a jar could be named totalCandy
  • 12. You declare a variable using the Dim and As keywords, as shown here. This line of code tells the program that you want to use a variable named aNumber, and that you want it to be a variable that stores whole numbers (the Integer data type). Because aNumber is an Integer, it can store only whole numbers. If you had wanted to store 42.5, for example, you would have used the Double data type. And if you wanted to store a word, you'd use a data type called a String. One other data type worth mentioning at this point is Boolean, which can store a True or False value. VB Dim aNumber As Integer
  • 13. Here are more examples of how to declare variables. Note: You can create a local variable without declaring the type of the variable by using local type inference. When you use local type inference, the type of the variable is determined by the value that is assigned to it. For more information, see Local Type Inference. VB Dim aDouble As Double Dim aName As String Dim YesOrNo As Boolean
  • 14. You assign a value to your variable with the = sign, which is sometimes called the assignment operator, as shown in the following example. This line of code takes the value 42 and stores it in the previously declared variable named aNumber. VB aNumber = 42
  • 15. Declaring and Assigning Variables with a Default Value As shown earlier, you can declare a variable on one line of code, and then later assign the value on another line. This can cause an error if you try to use the variable before assigning it a value. For that reason, it is a better idea to declare and assign variables on a single line. Even if you don't yet know what value the variable will hold, you can assign a default value. The code for declaring and assigning the same variables shown earlier would look like the following.
  • 16. VB Dim aDouble As Double = 0 Dim aName As String = "default string" Dim YesOrNo As Boolean = True
  • 17. Try it! In this exercise, you will write a short program that creates four variables, assigns them values, and then displays each value in a window called a message box. Let's begin by creating the project where the code will be stored. To create the project 1. If it is not already open, open Visual Basic from the Windows Start menu. 2. On the File menu, click New Project. 3. In the New Project dialog box on the Templates pane, click Windows Forms Application. 4. In the Name box, type Variables and then click OK. Visual Basic will create the files for your program and open the Form Designer. Next, you'll create the variables.
  • 18. To create variables and display their values 1.Double-click the form to open the Code Editor. The Code Editor opens to a section of code called Form1_Load. This section of code is an event handler, which is also referred to as a procedure. The code that you write in this procedure is the instructions that will be performed when the form is first loaded into memory. 2. In the Form1_Load procedure, type the following code. VB Dim anInteger As Integer = 42 Dim aSingle As Single = 39.345677653 Dim aString As String = "I like candy" Dim aBoolean As Boolean = True  This code declares four variables and assigns their default values. The four variables are an Integer, a Single, a String, and a Boolean. Tip: As you typed the code, you may have noticed that after you typed As, a list of words appeared underneath the cursor. This feature is called IntelliSense. It enables you to just type the first few letters of a word until the word is selected in the list. Once the word is selected, you can press the TAB key to finish the word.
  • 19. 3. Beneath the code you wrote in the previous step, type the following.  This code tells the program to display each value that you assigned in the previous step in a new window, using the MsgBox function. 4. Press F5 to run your program. Click OK for each message box as it appears. Note that the value of each variable is displayed in turn. You can close the form by clicking the x in the upper-right corner of the form. After the program has finished, you can go back and change the values that are assigned in the code—you'll see that the new values are displayed the next time that you run the program. VB MsgBox(anInteger) MsgBox(aSingle) MsgBox(aString) MsgBox(aBoolean) Note:Whenever you represent actual text in a program, you must enclose it in quotation marks (""). This tells the program to interpret the text as actual text instead of as a variable name. When you assign a Boolean variable a value of True or False, you do not enclose the word in quotation marks, because True and False are Visual Basic keywords with special meanings of their own.