--to use a variable in a program, it must be defined by giving it a type and identifier

eg: doubleOnce defined the variable must be given a value

eg:

the

__Using Named Constants__

-defined in a statement and begins with the word ** "const**"

__Choosing Identifiers__

- must start with a letter
- must contain only letters, digits and the underscore ( _ ) character
- can be of any length
- are case sensitive: Radius is different than radius

__Built in Data Types__

- used to store positive or negative real numbers (decimals)
- floating point numbers (decimals)
- when the number is very large, it will be stored in scientific notation: the computer stores
__1.23457 x 10__^{8}^{}^{ }as__1.23457e+08__ - the double value is rounded to six digits

2. __int ____and____ long__

- used to store positive and negative integers (no decimals!)
- only difference is the range of values :
__long____goes beyond 32767__

3. __char____:__

- used to store a single character
- can be used to store a single letter, digit or symbol like the % sign
- requires single quotation marks:

Example: char Ch:

Ch = 'A';

cout<<Ch<<endl;

displays : A__VARIABLE DEFINITIONS__

VARIABLES can be defined in single statements or in multiple variables in one line

example: int x,y,zChar ch1,ch2

__Expressions and Operators__

-built in arithmetic operations include: (*) multiplication,

(+) addition, (-) subtraction, and ( / ) division

**Promotion**: numeric values of various types can be mixed in an expression: an expression involving two doubles, results in a double, however, whenever an integer and a double are used, C++ promotes the value with the narrow range to the value with the wider range: integer becomes a double: this avoids the problem known in Pascal as "type mismatch"

**Integer Division: **if you divide two integers, the resulting number will be truncated, or the decimals will be cut off!

**Type Casting: **when real division is done, type casting converts one of the values into a real number

**Modulus Division: **represented by %, Modulus division returns the remainder....similar to MOD in Pascal

**Operator Precedence: **same as order of operations in mathematics

__Output Formatting__

- use
**width ( )**to control your output: creates a field width, so width(10) will allow 10 digits - use
**setf( )**to change the alignment (see handout) - use
**precision ( )**to specify the number of decimals