|
|
|
|
|
|
|
For nested If-Then-Else statements that form a generalized multi-way branch (the If-Then-Else-If, described in Chapter 5), a special style of indentation is used in the text. Here is an example: |
|
|
|
|
|
|
|
|
if (month == JANUARY)
monthNumber = 1;
else if (month == FEBRUARY)
monthNumber = 2;
else if (month == MARCH)
monthNumber = 3;
else if (month == APRIL)
.
.
.
else
monthNumber = 12; |
|
|
|
|
|
|
|
|
The remaining C++ statements all follow the basic indentation guideline mentioned previously. For reference purposes, here are examples of each. |
|
|
|
|
|
|
|
|
while (count <= 10)
{
cin >> value;
sum = sum + value;
count++;
}
do
{
GetAnswer(letter);
PutAnswer(letter);
} while (letter != N);
for (count = 1; count <= numSales; count++)
cout << *;
for (count = 10; count >= 1; count--)
{
inFile >> dataItem;
outFile << dataItem << << count << endl;
}
|
|
|
|
|
|