Chapter 02 - An Introduction To Object Oriented Programming...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
An Introduction To Object Oriented Programming Chapter 2 Using Data
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual C# 2008, Third Edition 2 Declaring Variables Constant Cannot be changed after a program is compiled Literal constant Its value is taken literally at each use Variable A named location in computer memory that can hold different values at different points in time Data type Describes the format and size of (amount of memory occupied by) a data item
Background image of page 2
Microsoft Visual C# 2008, Third Edition 3 Declaring Variables (continued)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual C# 2008, Third Edition 4 Declaring Variables (continued) Variable declaration Statement that names a variable and reserves storage Example: int myAge = 25; You can declare multiple variables of the same type In separate statements on different lines You can declare two variables of the same type in a single statement By using the type once and separating the variable declarations with a comma
Background image of page 4
Microsoft Visual C# 2008, Third Edition 5 Displaying Variable Values
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual C# 2008, Third Edition 6 Displaying Variable Values (continued)
Background image of page 6
Microsoft Visual C# 2008, Third Edition 7 Displaying Variable Values (continued) Format string A string of characters that optionally contains fixed text Contains one or more format items or placeholders for variable values Placeholder Consists of a pair of curly braces containing a number that indicates the desired variable’s position In a list that follows the string
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual C# 2008, Third Edition 8 Displaying Variable Values (continued)
Background image of page 8
Microsoft Visual C# 2008, Third Edition 9 Displaying Variable Values (continued) Formatting output
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 30

Chapter 02 - An Introduction To Object Oriented Programming...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online