SlideShare una empresa de Scribd logo
1 de 65
CHAPTER FOUR
Variables and
Arithmetic Operations
Objectives
 Create, modify, and program a TextBox object
 Use code to place data in Text property on Label object
 Use the AcceptButton and CancelButton properties
 Understand and declare String and Numeric variables
 Use assignments statements to place data in variables
 Use literals and constants in coding statements
Chapter 4: Variables and Arithmetic Operations 2
Objectives
 Understand scope rules for variables
 Convert string and numeric data
 Understand & use arithmetic operators & arithmetic operations
 Format and display numeric data as a string
 Create a form load event
 Create a concatenated string
 Debug a program
Chapter 4: Variables and Arithmetic Operations 3
Chapter 4: Variables and Arithmetic Operations 4
Introduction
TextBox Objects
 With Visual Studio open and the frmDigitalDownloads.vb
[Design] tabbed page visible, point to the TextBox .NET
component in the Toolbox
 Drag the TextBox .NET component onto the Windows Form
object at the desired location
Chapter 4: Variables and Arithmetic Operations 5
Chapter 4: Variables and Arithmetic Operations 6
TextBox Objects
When the upper-left corner of the pointer is located where you want
the TextBox object’s upper-left corner, release the left mouse button
Sizing and Positioning a TextBox
Object
 Enter txtNumberOfDownload into the Name property of the TextBox
 Scroll to the Text property and click the right column of the Text property
 Type the maximum number of characters the user normally will enter into
the text box and then press the ENTER key. Use the digit 8 because it is
wider than other digits. In this example, the value 888 is entered because
three digits is the maximum number of digits the user normally will enter
Chapter 4: Variables and Arithmetic Operations 7
Sizing and Positioning a TextBox
Object
 Drag the right edge of the TextBox object to resize the TextBox
object so it is slightly wider than an 888 entry
 Scroll to the Font property to change font to Century Gothic and
the font size to 12.
 To horizontally align the text in the label and the text in the text
box, drag the text box up until a red snap line indicates the
bottoms of the text are aligned. Then, release the left mouse
button
Chapter 4: Variables and Arithmetic Operations 8
Chapter 4: Variables and Arithmetic Operations 9
Sizing and Positioning a TextBox
Object
Aligning Text in a TextBox Object
 Scroll to the TextAlign property of the Text box
 Click the TextAlign property in the left column, and then click the
list arrow in the right
 Click Center in the TextAlign property list
Chapter 4: Variables and Arithmetic Operations 10
Chapter 4: Variables and Arithmetic Operations 11
Aligning Text in a TextBox Object
Creating a MultiLine Text Box
 Select the TextBox object, click the Action tag, and point to
the MultiLine check box
 Click the MultiLine check box
Chapter 4: Variables and Arithmetic Operations 12
Chapter 4: Variables and Arithmetic Operations 13
Creating a MaskedTextBox Object
Creating a MaskedTextBox Object
 Drag a MaskedTextBox component from the Toolbox to the
Windows Form object. Then, click the Action tag on the TextBox
object and point to the Set Mask command
 Click Set Mask on the MaskedTextBox Tasks list and then click the
Short date mask description in the Input Mask dialog box
 Click the OK button in the Input Mask dialog
Chapter 4: Variables and Arithmetic Operations 14
Chapter 4: Variables and Arithmetic Operations 15
Creating a MaskedTextBox Object
Label Objects
 Drag a Label object to the Form object to the correct location.
Name the label lblTotalCostOfDownloads. Change the label to the
appropriate font size (Century Gothic, 12 point).
 In the Text property for the Label object, enter the maximum
number of characters ($888.88) that will appear in the label during
execution of the program
 Drag the Label object up until the red snap line appears. Then
release the left mouse button
Chapter 4: Variables and Arithmetic Operations 16
Chapter 4: Variables and Arithmetic Operations 17
Label Objects
Accept Button in Form Properties
 The program will carry out the event handler processing
associated with the Accept button if the user clicks the button or if
the user presses ENTER
 Click a blank area in the Windows
 Scroll to and select the AcceptButton Properties.
 Click the AcceptButton property list arrow in the right column
 Click btnCalculateCost in the AcceptButton property list
Chapter 4: Variables and Arithmetic Operations 18
Chapter 4: Variables and Arithmetic Operations 19
Accept Button in Form Properties
Cancel Button in Form Properties
 When the user presses the ESC key, the event handler
processing for the button identified as the Cancel button will
be executed
 Click a blank area in the Windows Form object to select it
 Click the CancelButton property name in the left column in the
Properties window for the Windows Form object, and then
click the CancelButton list arrow
 Click the button name (btnClear) in the CancelButton property
list
Chapter 4: Variables and Arithmetic Operations 20
String Data Type
 A String variable allows any character to be stored in it
 The data type for the value the user enters in a TextBox object
and that is stored in the Text property of the TextBox object is
string
 A variable is a named location in RAM where data is stored
 A String variable is a named location in RAM that can store a
string valueChapter 4: Variables and Arithmetic Operations 21
Chapter 4: Variables and Arithmetic Operations 22
String Data Type
Assignment Statements
 One method to place data in the variable is to use an
assignment statement
Chapter 4: Variables and Arithmetic Operations 23
Assignment Statements
 In the code editing window type Dim followed by a space. Then, type
strNumberOfSongs on your keyboard
 Press the SPACEBAR, type the word As and then press the
SPACEBAR again
 Because the entry should be String, type str on your keyboard
 Press the ENTER key
Chapter 4: Variables and Arithmetic Operations 24
Assignment Statements
 Type strn. IntelliSense displays the variable name that starts with the
letter strn, the String variable strNumberOfDownloads
 Press the SPACEBAR, press the EQUAL SIGN key, and then press the
SPACEBAR
 Type txt to display the IntelliSense list of the Form objects, and
then type n to identify the txtNumberof Downloads Text Box object
in the IntelliSense list
 Press the PERIOD key and then, if necessary, type te to highlight the
Text entry in the IntelliSense list
 Press the ENTER key
Chapter 4: Variables and Arithmetic Operations 25
Chapter 4: Variables and Arithmetic Operations 26
Assignment Statements
Numeric Data Types
 A numeric data type must be used in arithmetic
operations
Chapter 4: Variables and Arithmetic Operations 27
Numeric Data Types
Chapter 4: Variables and Arithmetic Operations 28
Chapter 4: Variables and Arithmetic Operations 29
Other Data Types
Chapter 4: Variables and Arithmetic Operations 30
Other Data Types
Chapter 4: Variables and Arithmetic Operations 31
Miscellaneous Data Types
Chapter 4: Variables and Arithmetic Operations 32
Variable Prefixes
Literals
 A value is called a literal when the value being used in the
assignment statement is literally the value that is required
Chapter 4: Variables and Arithmetic Operations 33
Forced Literal Types
 Sometimes you might want a literal to be a different
data type than the Visual Basic default
Chapter 4: Variables and Arithmetic Operations 34
Constants
 A constant variable will contain one permanent value
throughout the execution of the program
Chapter 4: Variables and Arithmetic Operations 35
Constants
 Constant variable the definitions begins with the letters Const, not the letters Dim
 The value of the constant must be on the same line as the definition of the constant.
 At run time, you cannot attempt to change a constant variable value.
 The letter c often is placed before the prefix of the constant variable name to
identify throughout the program that it is a constant variable and cannot be
changed
 Other than the letter c, constant variable names us the same naming convention
Chapter 4: Variables and Arithmetic Operations 36
Referencing a Variable
 When a variable is declared, it will be underlined with a green
squiggly line until it is referenced in a statement
 It is mandatory when using a variable in a program that the
variable is defined prior to using the variable in a statement
Chapter 4: Variables and Arithmetic Operations 37
Scope of Variables
 The scope of a variable specifies where within the program the
variable can be referenced in a Visual Basic statement
 A variable can be referenced only within the region of the
program where it is defined
 The code between the Sub statement and the End Sub
statement is a procedure
Chapter 4: Variables and Arithmetic Operations 38
Scope of Variables (Continued)
 A variable that can only be referenced within the region of the
program where it is defined is called a local variable
 Local variables have a certain lifetime in the program
 Global variables can be used in multiple regions of a program
Chapter 4: Variables and Arithmetic Operations 39
Converting Variable Data
 Visual Basic includes several procedures that allow you to
convert one data type to another data type
 A procedure to convert a String data type to an Integer data
type is named ToInt32
 The procedure is found in the Convert class, which is available
in a Visual Studio 2010 class library
Chapter 4: Variables and Arithmetic Operations 40
Using a Procedure
 A procedure that performs its task but does not return a value
is called a Sub procedure
 A procedure that returns a value is called a Function procedure,
or a function
 An argument identifies a value required by a procedure
 Every procedure is part of a class
Chapter 4: Variables and Arithmetic Operations 41
Chapter 4: Variables and Arithmetic Operations 42
Using a Procedure
Option Strict On
 Visual Basic will, by default, automatically convert
data types if the data type on the right side of the
equal sign in an assignment statement is different
from the data type on the left side of the equal
sign
 To prevent automatic conversion of values, the
developer must insert the Option Strict On
statement in the program prior to any event
handler code in the program
Chapter 4: Variables and Arithmetic Operations 43
Chapter 4: Variables and Arithmetic Operations 44
Option Strict On
The Option Strict On statement explicitly disallows any
default data type conversions in which data loss would occur
and any conversion between numeric types and strings
Chapter 4: Variables and Arithmetic Operations 45
Arithmetic Operations
Chapter 4: Variables and Arithmetic Operations 46
Arithmetic Operators
Multiple Operations
(Order of Operations)
 A single assignment statement can contain multiple operations
 Hierarchy of Operations
 Exponentiation (^) is performed first
 Multiplication (*) and division (/) are performed next
 Integer division () is next
 MOD then occurs
 Addition (+) and subtraction (-) are performed last
 Within these five steps, calculations are performed left to right
Chapter 4: Variables and Arithmetic Operations 47
Displaying Numeric Output Data
Chapter 4: Variables and Arithmetic Operations 48
Format Specifications
for the ToString Function
 Use the format specifier to identify the format for
the numeric data to be returned by the ToString
function
Chapter 4: Variables and Arithmetic Operations 49
Precision Specifier
 The precision specifier is a number that is included within
quotation marks in the function call to identify the number of
positions to the right of the decimal point that should be returned
Chapter 4: Variables and Arithmetic Operations 50
Clear Procedure
 The Clear procedure clears any data currently placed
in the Text property of a TextBox object
Chapter 4: Variables and Arithmetic Operations 51
Clearing the Text Property of a Label
 The Clear procedure cannot be used with a Label object
 You must write an assignment statement that assigns a null
length string to the Text property of a Label object
Chapter 4: Variables and Arithmetic Operations 52
Setting the Focus
 When the focus is on a
TextBox object, the
insertion point is
located in the text box,
and will be blinking
Chapter 4: Variables and Arithmetic Operations 53
Form Load Event
 A form load event occurs when the program starts and the
Digital Downloads form is loaded
 This event handler completes the following tasks:
 Display the cost per download heading
 Clear the placeholder from the lblTotalCostOfDownloads Text
property
 Set the focus on the txtNumberOfDownloads text box
Chapter 4: Variables and Arithmetic Operations 54
Concatenation
 The process of joining two different values into a single string
is called concatenation
 The values being concatenated must be String data types
Chapter 4: Variables and Arithmetic Operations 55
Chapter 4: Variables and Arithmetic Operations 56
Concatenation
Class Scope
 When a variable is referenced in two different event handling
procedures, it must be defined at the class level instead of the
procedure (event handler) level
Chapter 4: Variables and Arithmetic Operations 57
Debugging Your Program
Chapter 4: Variables and Arithmetic Operations 58
 A Format Exception
occurs when the user
enters data that a
statement within the
program cannot process
properly
Debugging Your Program
 An Overflow Exception occurs when the user enters a
value greater than the maximum value that can be
processed by the statement
 It is not possible to divide by zero, so if your program
contains a division operation and the divisor is equal
to zero, the Divide By Zero Exception will occur
Chapter 4: Variables and Arithmetic Operations 59
Chapter 4: Variables and Arithmetic Operations 60
Program Design
Chapter 4: Variables and Arithmetic Operations 61
Program Design
Chapter 4: Variables and Arithmetic Operations 62
Event Planning Document
Summary
 Create, modify, and program a TextBox object
 Use code to place data in the Text property of a Label object
 Use the AcceptButton and CancelButton properties
 Understand and declare String and Numeric variables
 Use assignments statements to place data in variables
 Use literals and constants in coding statements
Chapter 4: Variables and Arithmetic Operations 63
Summary
 Understand scope rules for variables
 Convert string and numeric data
 Understand and use arithmetic operators and operations
 Format and display numeric data as a string
 Create a form load event
 Create a concatenated string
 Debug a program
Chapter 4: Variables and Arithmetic Operations 64
CHAPTER FOUR COMPLETE
Variables and
Arithmetic Operations

Más contenido relacionado

La actualidad más candente

Chapter 05 show
Chapter 05 showChapter 05 show
Chapter 05 showchda01008
 
Cookbook Oracle SOA Business Rules
Cookbook Oracle SOA Business RulesCookbook Oracle SOA Business Rules
Cookbook Oracle SOA Business RulesEmiel Paasschens
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Designpatf719
 
C# Tutorial MSM_Murach chapter-10-slides
C# Tutorial MSM_Murach chapter-10-slidesC# Tutorial MSM_Murach chapter-10-slides
C# Tutorial MSM_Murach chapter-10-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-02-slides
C# Tutorial MSM_Murach chapter-02-slidesC# Tutorial MSM_Murach chapter-02-slides
C# Tutorial MSM_Murach chapter-02-slidesSami Mut
 
Xamarin.Forms Hands On Lab (Begineer)
Xamarin.Forms Hands On Lab (Begineer)Xamarin.Forms Hands On Lab (Begineer)
Xamarin.Forms Hands On Lab (Begineer)Cheah Eng Soon
 
Notes how to work with variables, constants and do calculations
Notes how to work with variables, constants and do calculationsNotes how to work with variables, constants and do calculations
Notes how to work with variables, constants and do calculationsWilliam Olivier
 

La actualidad más candente (19)

Chapter 05 show
Chapter 05 showChapter 05 show
Chapter 05 show
 
Cookbook Oracle SOA Business Rules
Cookbook Oracle SOA Business RulesCookbook Oracle SOA Business Rules
Cookbook Oracle SOA Business Rules
 
Visual C# 2010
Visual C# 2010Visual C# 2010
Visual C# 2010
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Design
 
4.C#
4.C#4.C#
4.C#
 
Tugas testing
Tugas testingTugas testing
Tugas testing
 
C# Tutorial MSM_Murach chapter-10-slides
C# Tutorial MSM_Murach chapter-10-slidesC# Tutorial MSM_Murach chapter-10-slides
C# Tutorial MSM_Murach chapter-10-slides
 
Excel chapter-7
Excel chapter-7Excel chapter-7
Excel chapter-7
 
SPF WinForm Programs
SPF WinForm ProgramsSPF WinForm Programs
SPF WinForm Programs
 
Chapter03 Ppt
Chapter03 PptChapter03 Ppt
Chapter03 Ppt
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
 
C# Tutorial MSM_Murach chapter-02-slides
C# Tutorial MSM_Murach chapter-02-slidesC# Tutorial MSM_Murach chapter-02-slides
C# Tutorial MSM_Murach chapter-02-slides
 
Xamarin.Forms Hands On Lab (Begineer)
Xamarin.Forms Hands On Lab (Begineer)Xamarin.Forms Hands On Lab (Begineer)
Xamarin.Forms Hands On Lab (Begineer)
 
Notes how to work with variables, constants and do calculations
Notes how to work with variables, constants and do calculationsNotes how to work with variables, constants and do calculations
Notes how to work with variables, constants and do calculations
 
Visual basic
Visual basicVisual basic
Visual basic
 
Lab1
Lab1Lab1
Lab1
 
Ms Access
Ms AccessMs Access
Ms Access
 
Vb%20 tutorial
Vb%20 tutorialVb%20 tutorial
Vb%20 tutorial
 
2 front panel
2  front panel2  front panel
2 front panel
 

Destacado

Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming francopw
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programmingRoger Argarin
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Salim M
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computersimran153
 
Visual Basic Calculator
Visual Basic CalculatorVisual Basic Calculator
Visual Basic CalculatorSpy Seat
 
Transforming Power Point Show with VBA
Transforming Power Point Show with VBATransforming Power Point Show with VBA
Transforming Power Point Show with VBADCPS
 
Basic calculator tutorial
Basic calculator tutorialBasic calculator tutorial
Basic calculator tutorialGilkye
 
Curso vb2010L1
Curso vb2010L1Curso vb2010L1
Curso vb2010L1Juan Islas
 
Examen writer
Examen writerExamen writer
Examen writerUTE
 
Ejercicios de open office writer
Ejercicios de open office writerEjercicios de open office writer
Ejercicios de open office writerjoseandresmateos
 

Destacado (20)

Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0
 
The Best Source Code VB
The Best Source Code VBThe Best Source Code VB
The Best Source Code VB
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computer
 
Visual Basic Calculator
Visual Basic CalculatorVisual Basic Calculator
Visual Basic Calculator
 
Vb 6ch123
Vb 6ch123Vb 6ch123
Vb 6ch123
 
Richtextbox
RichtextboxRichtextbox
Richtextbox
 
Prg1 clases01
Prg1 clases01Prg1 clases01
Prg1 clases01
 
Ejer calc basico
Ejer calc basicoEjer calc basico
Ejer calc basico
 
VB Codes
VB CodesVB Codes
VB Codes
 
Transforming Power Point Show with VBA
Transforming Power Point Show with VBATransforming Power Point Show with VBA
Transforming Power Point Show with VBA
 
Basic calculator tutorial
Basic calculator tutorialBasic calculator tutorial
Basic calculator tutorial
 
Vb 6.0 controls
Vb 6.0 controlsVb 6.0 controls
Vb 6.0 controls
 
Ejercicios writer1
Ejercicios writer1Ejercicios writer1
Ejercicios writer1
 
Curso vb2010L1
Curso vb2010L1Curso vb2010L1
Curso vb2010L1
 
Examen writer
Examen writerExamen writer
Examen writer
 
Ejercicios de open office writer
Ejercicios de open office writerEjercicios de open office writer
Ejercicios de open office writer
 

Similar a VB Variables and Arithmetic Operations

Variables and calculations_chpt_4
Variables and calculations_chpt_4Variables and calculations_chpt_4
Variables and calculations_chpt_4cmontanez
 
EX19_AC_CH03_GRADER_HOE_AS_InstructionsGrader - Instructi
EX19_AC_CH03_GRADER_HOE_AS_InstructionsGrader - InstructiEX19_AC_CH03_GRADER_HOE_AS_InstructionsGrader - Instructi
EX19_AC_CH03_GRADER_HOE_AS_InstructionsGrader - InstructiBetseyCalderon89
 
Chapter2pp
Chapter2ppChapter2pp
Chapter2ppJ. C.
 
Lesson 4 PowerPoint
Lesson 4 PowerPointLesson 4 PowerPoint
Lesson 4 PowerPointLinda Bodrie
 
MaciasWinter 2020ENG 107Project #2A Year in Gami.docx
MaciasWinter 2020ENG 107Project #2A Year in Gami.docxMaciasWinter 2020ENG 107Project #2A Year in Gami.docx
MaciasWinter 2020ENG 107Project #2A Year in Gami.docxcroysierkathey
 
Paste Only Plain Text in RichTextBox Control using Visual Basic.Net
Paste Only Plain Text in RichTextBox Control using Visual Basic.NetPaste Only Plain Text in RichTextBox Control using Visual Basic.Net
Paste Only Plain Text in RichTextBox Control using Visual Basic.NetDaniel DotNet
 
Html Xhtml And Xml 3e Tutorial 6
Html Xhtml And Xml 3e Tutorial 6Html Xhtml And Xml 3e Tutorial 6
Html Xhtml And Xml 3e Tutorial 6larsonsb
 
Visual Basics for Application
Visual Basics for Application Visual Basics for Application
Visual Basics for Application Raghu nath
 
Visual Programming
Visual ProgrammingVisual Programming
Visual ProgrammingBagzzz
 
Report painter in SAP
Report painter in SAPReport painter in SAP
Report painter in SAPRajeev Kumar
 
Create this program in visual studio C# The design of the form A text.pdf
Create this program in visual studio C# The design of the form A text.pdfCreate this program in visual studio C# The design of the form A text.pdf
Create this program in visual studio C# The design of the form A text.pdfshyamsunder1211
 
Cognos TM1 Assignments
Cognos TM1 Assignments Cognos TM1 Assignments
Cognos TM1 Assignments rameshkp054
 
MS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & ChartsMS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & Chartsdnbakhan
 

Similar a VB Variables and Arithmetic Operations (20)

Variables and calculations_chpt_4
Variables and calculations_chpt_4Variables and calculations_chpt_4
Variables and calculations_chpt_4
 
EX19_AC_CH03_GRADER_HOE_AS_InstructionsGrader - Instructi
EX19_AC_CH03_GRADER_HOE_AS_InstructionsGrader - InstructiEX19_AC_CH03_GRADER_HOE_AS_InstructionsGrader - Instructi
EX19_AC_CH03_GRADER_HOE_AS_InstructionsGrader - Instructi
 
Sharbani bhattacharya VB Structures
Sharbani bhattacharya VB StructuresSharbani bhattacharya VB Structures
Sharbani bhattacharya VB Structures
 
Fahri tugas cloud1
Fahri tugas cloud1Fahri tugas cloud1
Fahri tugas cloud1
 
Chapter2pp
Chapter2ppChapter2pp
Chapter2pp
 
Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 
Lesson 4 PowerPoint
Lesson 4 PowerPointLesson 4 PowerPoint
Lesson 4 PowerPoint
 
MaciasWinter 2020ENG 107Project #2A Year in Gami.docx
MaciasWinter 2020ENG 107Project #2A Year in Gami.docxMaciasWinter 2020ENG 107Project #2A Year in Gami.docx
MaciasWinter 2020ENG 107Project #2A Year in Gami.docx
 
Paste Only Plain Text in RichTextBox Control using Visual Basic.Net
Paste Only Plain Text in RichTextBox Control using Visual Basic.NetPaste Only Plain Text in RichTextBox Control using Visual Basic.Net
Paste Only Plain Text in RichTextBox Control using Visual Basic.Net
 
Html Xhtml And Xml 3e Tutorial 6
Html Xhtml And Xml 3e Tutorial 6Html Xhtml And Xml 3e Tutorial 6
Html Xhtml And Xml 3e Tutorial 6
 
Visual Basics for Application
Visual Basics for Application Visual Basics for Application
Visual Basics for Application
 
Visual Programming
Visual ProgrammingVisual Programming
Visual Programming
 
Ppt lesson 05
Ppt lesson 05Ppt lesson 05
Ppt lesson 05
 
Lesson 5 PP
Lesson 5 PPLesson 5 PP
Lesson 5 PP
 
OpenCastLabs Excel chapter-3
OpenCastLabs Excel chapter-3OpenCastLabs Excel chapter-3
OpenCastLabs Excel chapter-3
 
Report painter in SAP
Report painter in SAPReport painter in SAP
Report painter in SAP
 
Savitch ch 04
Savitch ch 04Savitch ch 04
Savitch ch 04
 
Create this program in visual studio C# The design of the form A text.pdf
Create this program in visual studio C# The design of the form A text.pdfCreate this program in visual studio C# The design of the form A text.pdf
Create this program in visual studio C# The design of the form A text.pdf
 
Cognos TM1 Assignments
Cognos TM1 Assignments Cognos TM1 Assignments
Cognos TM1 Assignments
 
MS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & ChartsMS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & Charts
 

Último

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

VB Variables and Arithmetic Operations

  • 2. Objectives  Create, modify, and program a TextBox object  Use code to place data in Text property on Label object  Use the AcceptButton and CancelButton properties  Understand and declare String and Numeric variables  Use assignments statements to place data in variables  Use literals and constants in coding statements Chapter 4: Variables and Arithmetic Operations 2
  • 3. Objectives  Understand scope rules for variables  Convert string and numeric data  Understand & use arithmetic operators & arithmetic operations  Format and display numeric data as a string  Create a form load event  Create a concatenated string  Debug a program Chapter 4: Variables and Arithmetic Operations 3
  • 4. Chapter 4: Variables and Arithmetic Operations 4 Introduction
  • 5. TextBox Objects  With Visual Studio open and the frmDigitalDownloads.vb [Design] tabbed page visible, point to the TextBox .NET component in the Toolbox  Drag the TextBox .NET component onto the Windows Form object at the desired location Chapter 4: Variables and Arithmetic Operations 5
  • 6. Chapter 4: Variables and Arithmetic Operations 6 TextBox Objects When the upper-left corner of the pointer is located where you want the TextBox object’s upper-left corner, release the left mouse button
  • 7. Sizing and Positioning a TextBox Object  Enter txtNumberOfDownload into the Name property of the TextBox  Scroll to the Text property and click the right column of the Text property  Type the maximum number of characters the user normally will enter into the text box and then press the ENTER key. Use the digit 8 because it is wider than other digits. In this example, the value 888 is entered because three digits is the maximum number of digits the user normally will enter Chapter 4: Variables and Arithmetic Operations 7
  • 8. Sizing and Positioning a TextBox Object  Drag the right edge of the TextBox object to resize the TextBox object so it is slightly wider than an 888 entry  Scroll to the Font property to change font to Century Gothic and the font size to 12.  To horizontally align the text in the label and the text in the text box, drag the text box up until a red snap line indicates the bottoms of the text are aligned. Then, release the left mouse button Chapter 4: Variables and Arithmetic Operations 8
  • 9. Chapter 4: Variables and Arithmetic Operations 9 Sizing and Positioning a TextBox Object
  • 10. Aligning Text in a TextBox Object  Scroll to the TextAlign property of the Text box  Click the TextAlign property in the left column, and then click the list arrow in the right  Click Center in the TextAlign property list Chapter 4: Variables and Arithmetic Operations 10
  • 11. Chapter 4: Variables and Arithmetic Operations 11 Aligning Text in a TextBox Object
  • 12. Creating a MultiLine Text Box  Select the TextBox object, click the Action tag, and point to the MultiLine check box  Click the MultiLine check box Chapter 4: Variables and Arithmetic Operations 12
  • 13. Chapter 4: Variables and Arithmetic Operations 13 Creating a MaskedTextBox Object
  • 14. Creating a MaskedTextBox Object  Drag a MaskedTextBox component from the Toolbox to the Windows Form object. Then, click the Action tag on the TextBox object and point to the Set Mask command  Click Set Mask on the MaskedTextBox Tasks list and then click the Short date mask description in the Input Mask dialog box  Click the OK button in the Input Mask dialog Chapter 4: Variables and Arithmetic Operations 14
  • 15. Chapter 4: Variables and Arithmetic Operations 15 Creating a MaskedTextBox Object
  • 16. Label Objects  Drag a Label object to the Form object to the correct location. Name the label lblTotalCostOfDownloads. Change the label to the appropriate font size (Century Gothic, 12 point).  In the Text property for the Label object, enter the maximum number of characters ($888.88) that will appear in the label during execution of the program  Drag the Label object up until the red snap line appears. Then release the left mouse button Chapter 4: Variables and Arithmetic Operations 16
  • 17. Chapter 4: Variables and Arithmetic Operations 17 Label Objects
  • 18. Accept Button in Form Properties  The program will carry out the event handler processing associated with the Accept button if the user clicks the button or if the user presses ENTER  Click a blank area in the Windows  Scroll to and select the AcceptButton Properties.  Click the AcceptButton property list arrow in the right column  Click btnCalculateCost in the AcceptButton property list Chapter 4: Variables and Arithmetic Operations 18
  • 19. Chapter 4: Variables and Arithmetic Operations 19 Accept Button in Form Properties
  • 20. Cancel Button in Form Properties  When the user presses the ESC key, the event handler processing for the button identified as the Cancel button will be executed  Click a blank area in the Windows Form object to select it  Click the CancelButton property name in the left column in the Properties window for the Windows Form object, and then click the CancelButton list arrow  Click the button name (btnClear) in the CancelButton property list Chapter 4: Variables and Arithmetic Operations 20
  • 21. String Data Type  A String variable allows any character to be stored in it  The data type for the value the user enters in a TextBox object and that is stored in the Text property of the TextBox object is string  A variable is a named location in RAM where data is stored  A String variable is a named location in RAM that can store a string valueChapter 4: Variables and Arithmetic Operations 21
  • 22. Chapter 4: Variables and Arithmetic Operations 22 String Data Type
  • 23. Assignment Statements  One method to place data in the variable is to use an assignment statement Chapter 4: Variables and Arithmetic Operations 23
  • 24. Assignment Statements  In the code editing window type Dim followed by a space. Then, type strNumberOfSongs on your keyboard  Press the SPACEBAR, type the word As and then press the SPACEBAR again  Because the entry should be String, type str on your keyboard  Press the ENTER key Chapter 4: Variables and Arithmetic Operations 24
  • 25. Assignment Statements  Type strn. IntelliSense displays the variable name that starts with the letter strn, the String variable strNumberOfDownloads  Press the SPACEBAR, press the EQUAL SIGN key, and then press the SPACEBAR  Type txt to display the IntelliSense list of the Form objects, and then type n to identify the txtNumberof Downloads Text Box object in the IntelliSense list  Press the PERIOD key and then, if necessary, type te to highlight the Text entry in the IntelliSense list  Press the ENTER key Chapter 4: Variables and Arithmetic Operations 25
  • 26. Chapter 4: Variables and Arithmetic Operations 26 Assignment Statements
  • 27. Numeric Data Types  A numeric data type must be used in arithmetic operations Chapter 4: Variables and Arithmetic Operations 27
  • 28. Numeric Data Types Chapter 4: Variables and Arithmetic Operations 28
  • 29. Chapter 4: Variables and Arithmetic Operations 29 Other Data Types
  • 30. Chapter 4: Variables and Arithmetic Operations 30 Other Data Types
  • 31. Chapter 4: Variables and Arithmetic Operations 31 Miscellaneous Data Types
  • 32. Chapter 4: Variables and Arithmetic Operations 32 Variable Prefixes
  • 33. Literals  A value is called a literal when the value being used in the assignment statement is literally the value that is required Chapter 4: Variables and Arithmetic Operations 33
  • 34. Forced Literal Types  Sometimes you might want a literal to be a different data type than the Visual Basic default Chapter 4: Variables and Arithmetic Operations 34
  • 35. Constants  A constant variable will contain one permanent value throughout the execution of the program Chapter 4: Variables and Arithmetic Operations 35
  • 36. Constants  Constant variable the definitions begins with the letters Const, not the letters Dim  The value of the constant must be on the same line as the definition of the constant.  At run time, you cannot attempt to change a constant variable value.  The letter c often is placed before the prefix of the constant variable name to identify throughout the program that it is a constant variable and cannot be changed  Other than the letter c, constant variable names us the same naming convention Chapter 4: Variables and Arithmetic Operations 36
  • 37. Referencing a Variable  When a variable is declared, it will be underlined with a green squiggly line until it is referenced in a statement  It is mandatory when using a variable in a program that the variable is defined prior to using the variable in a statement Chapter 4: Variables and Arithmetic Operations 37
  • 38. Scope of Variables  The scope of a variable specifies where within the program the variable can be referenced in a Visual Basic statement  A variable can be referenced only within the region of the program where it is defined  The code between the Sub statement and the End Sub statement is a procedure Chapter 4: Variables and Arithmetic Operations 38
  • 39. Scope of Variables (Continued)  A variable that can only be referenced within the region of the program where it is defined is called a local variable  Local variables have a certain lifetime in the program  Global variables can be used in multiple regions of a program Chapter 4: Variables and Arithmetic Operations 39
  • 40. Converting Variable Data  Visual Basic includes several procedures that allow you to convert one data type to another data type  A procedure to convert a String data type to an Integer data type is named ToInt32  The procedure is found in the Convert class, which is available in a Visual Studio 2010 class library Chapter 4: Variables and Arithmetic Operations 40
  • 41. Using a Procedure  A procedure that performs its task but does not return a value is called a Sub procedure  A procedure that returns a value is called a Function procedure, or a function  An argument identifies a value required by a procedure  Every procedure is part of a class Chapter 4: Variables and Arithmetic Operations 41
  • 42. Chapter 4: Variables and Arithmetic Operations 42 Using a Procedure
  • 43. Option Strict On  Visual Basic will, by default, automatically convert data types if the data type on the right side of the equal sign in an assignment statement is different from the data type on the left side of the equal sign  To prevent automatic conversion of values, the developer must insert the Option Strict On statement in the program prior to any event handler code in the program Chapter 4: Variables and Arithmetic Operations 43
  • 44. Chapter 4: Variables and Arithmetic Operations 44 Option Strict On The Option Strict On statement explicitly disallows any default data type conversions in which data loss would occur and any conversion between numeric types and strings
  • 45. Chapter 4: Variables and Arithmetic Operations 45 Arithmetic Operations
  • 46. Chapter 4: Variables and Arithmetic Operations 46 Arithmetic Operators
  • 47. Multiple Operations (Order of Operations)  A single assignment statement can contain multiple operations  Hierarchy of Operations  Exponentiation (^) is performed first  Multiplication (*) and division (/) are performed next  Integer division () is next  MOD then occurs  Addition (+) and subtraction (-) are performed last  Within these five steps, calculations are performed left to right Chapter 4: Variables and Arithmetic Operations 47
  • 48. Displaying Numeric Output Data Chapter 4: Variables and Arithmetic Operations 48
  • 49. Format Specifications for the ToString Function  Use the format specifier to identify the format for the numeric data to be returned by the ToString function Chapter 4: Variables and Arithmetic Operations 49
  • 50. Precision Specifier  The precision specifier is a number that is included within quotation marks in the function call to identify the number of positions to the right of the decimal point that should be returned Chapter 4: Variables and Arithmetic Operations 50
  • 51. Clear Procedure  The Clear procedure clears any data currently placed in the Text property of a TextBox object Chapter 4: Variables and Arithmetic Operations 51
  • 52. Clearing the Text Property of a Label  The Clear procedure cannot be used with a Label object  You must write an assignment statement that assigns a null length string to the Text property of a Label object Chapter 4: Variables and Arithmetic Operations 52
  • 53. Setting the Focus  When the focus is on a TextBox object, the insertion point is located in the text box, and will be blinking Chapter 4: Variables and Arithmetic Operations 53
  • 54. Form Load Event  A form load event occurs when the program starts and the Digital Downloads form is loaded  This event handler completes the following tasks:  Display the cost per download heading  Clear the placeholder from the lblTotalCostOfDownloads Text property  Set the focus on the txtNumberOfDownloads text box Chapter 4: Variables and Arithmetic Operations 54
  • 55. Concatenation  The process of joining two different values into a single string is called concatenation  The values being concatenated must be String data types Chapter 4: Variables and Arithmetic Operations 55
  • 56. Chapter 4: Variables and Arithmetic Operations 56 Concatenation
  • 57. Class Scope  When a variable is referenced in two different event handling procedures, it must be defined at the class level instead of the procedure (event handler) level Chapter 4: Variables and Arithmetic Operations 57
  • 58. Debugging Your Program Chapter 4: Variables and Arithmetic Operations 58  A Format Exception occurs when the user enters data that a statement within the program cannot process properly
  • 59. Debugging Your Program  An Overflow Exception occurs when the user enters a value greater than the maximum value that can be processed by the statement  It is not possible to divide by zero, so if your program contains a division operation and the divisor is equal to zero, the Divide By Zero Exception will occur Chapter 4: Variables and Arithmetic Operations 59
  • 60. Chapter 4: Variables and Arithmetic Operations 60 Program Design
  • 61. Chapter 4: Variables and Arithmetic Operations 61 Program Design
  • 62. Chapter 4: Variables and Arithmetic Operations 62 Event Planning Document
  • 63. Summary  Create, modify, and program a TextBox object  Use code to place data in the Text property of a Label object  Use the AcceptButton and CancelButton properties  Understand and declare String and Numeric variables  Use assignments statements to place data in variables  Use literals and constants in coding statements Chapter 4: Variables and Arithmetic Operations 63
  • 64. Summary  Understand scope rules for variables  Convert string and numeric data  Understand and use arithmetic operators and operations  Format and display numeric data as a string  Create a form load event  Create a concatenated string  Debug a program Chapter 4: Variables and Arithmetic Operations 64
  • 65. CHAPTER FOUR COMPLETE Variables and Arithmetic Operations