How to Work with Numeric and String Data Murach, Chapter 4, Part III, pp. 116 - 126 9/23/2008
Two Data Types Value types : variables Reference types: variables Store their own data Are supported by a structure Reference types: variables Do not store their own data Store a reference to a memory location Two different string variables can reference the same string location. Supported by a class (object created from class) 9/23/2008
9/23/2008
9/23/2008
Murach’s Visual Basic 2008, C4 © 2008, Mike Murach & Associates, Inc.
Murach’s Visual Basic 2008, C4 © 2008, Mike Murach & Associates, Inc.
9/23/2008
9/23/2008
9/23/2008
Other ways to convert data types ToString method Parse method Shared methods of the Convert class 9/23/2008
Murach’s Visual Basic 2008, C4 © 2008, Mike Murach & Associates, Inc.
Murach’s Visual Basic 2008, C4 © 2008, Mike Murach & Associates, Inc.
Murach’s Visual Basic 2008, C4 © 2008, Mike Murach & Associates, Inc.
Murach’s Visual Basic 2008, C4 © 2008, Mike Murach & Associates, Inc.
Murach’s Visual Basic 2008, C4 © 2008, Mike Murach & Associates, Inc.
Other methods to convert numbers to formatted strings The ToString method with formatting codes The Format method of the String class Pp. 126 and 127 9/23/2008
Other chapter topics Variable Scope (on test) Enumeration (not on test) – defines a set of related constants. Nullable types (not on test) – useful for databases 9/23/2008
Optional practice Exercise 4-1 9/23/2008