Download presentation

Presentation is loading. Please wait.

Published byBailey Clee Modified over 2 years ago

1
Ch. 3 Variables VB.Net Programming

2
Data Types Boolean – True or False values Short – Small integers (+/- 32,767) Integer – Medium-size integers (+/- 2 billion) Long – Large integers (+/- 9E+18) Single – Less accurate decimals (6 digits of precision) Double – More accurate decimals (10 digits of precision) Decimal –Generic decimals String – Words and numbers not used in calculations

3
Declaring Variables and Constants Variable – a named memory location that is used to store a value that can be changed during run time To declare a variable: Dim VarName As DataType = InitialValue (Initial Value is optional) Constant – a named memory location that is used to store a value that cannot be changed during run time To declare a constant: Const ConstName As DataType = Value

4
Formatting Numeric Output VarName.ToString(“FormatSpecifierPrecisionSpecifier”) See page 101 in your textbook for a full list. Example of currency formatting: VarName.ToString(“C”) VarName will be displayed with a $ sign and two decimal places. Example of rounding to 2 decimal places: VarName.ToString(“F2”)

Similar presentations

OK

An Introduction to Programming with C++ Fifth Edition Chapter 4 Chapter 4: Variables, Constants, and Arithmetic Operators.

An Introduction to Programming with C++ Fifth Edition Chapter 4 Chapter 4: Variables, Constants, and Arithmetic Operators.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on google chrome os Nokia acquired by microsoft ppt online Ppt on coalition government Leed ppt on energy and atmosphere Ppt on my school life Ppt on acid base and salt Ppt on product advertising pitch Ppt on the articles of confederation Ppt on site selection of thermal power plant Convert flash video to ppt online