CHAPTER 2: C++ BASICS

2.1 Variables and Assignments

Variables
Identifiers
Variable Declaration
Assignment Statements
Initializing Variables

2.2 Input and Output
Output Using cout
Input Using cin
Designing I/O

2.3 Data Types and Expressions
Variable Type int
Variable Type float and double
Type Compatibilities
Arithmetic Operations and Expressions
Variable Type char
Variable Type bool
Boolean Expressions
Strings

2.4 Branching Mechanisms
if-Statements
if-else-Statements
Nasty Nested if and if-else Statements
Blocks
Multiway if-else Statements
The switch-Statement
The conditional (?:) Expression

2.5 Loop Mechanisms
Loop Mechanisms
The while-loop
The do-while-loop
The for-loop
Increment and Decrement Operators
What kind of Loop to Use
The break- and the continue-Statements
Loops for Sums and Products
Ending a Loop
Nested Loops
Examples of Programs Having Loops and Branches
Debugging Loops

2.5 Program Style
Programming In Style
Indenting
Comments