int Lowest (int Limit)
// pre: The input stream cin contains at least three integers separated by blanks.
// There are no non-integer values in cin. "Limit" has a value between 0 and 5.
//
// post: Limit is unchanged. All integer values in cout have been read in. The lowest value
// read in is returned as the value of the function.
//
int class_size;
rather than
int c;
const float tax_rate = 0.06;
.
.
.
tax = total * tax_rate;
rather than
tax = total * 0.06;
.
.
.
cin >> limit;
counter = 1;
while (counter <= limit)
{
cout << "Enter an integer grade value" << endl;
cin >> agrade;
total = total + agrade;
counter++;
}
if (limit > 0)
average = total / limit;
else
average = 0.0;
rather than
.
.
.
cin >> limit;counter = 1;
while (counter <= limit){
cout << "Enter an integer grade value" << endl;cin >> agrade;
total = total + agrade;
counter++;}
if (limit > 0)
average = total / limit; else average = 0.0;
To some extent, exactly how white space is used is a matter of individual style. However, you must use
indentation to indicate levels of control. Also, consistent use of white space within a program is
important. . . . int x=0;rather than
. . . int x; . . . x=0;