|
Reads and organizes income statistics. - Parameters:
-
| incomeData | A TableType of income statistics. |
- Precondition:
- The calling program gives directions and prompts the user. Each input line contains exactly two integers in the form
G N , where N is the number of people with an income in the G -thousand-dollar group and LOW_END <= G <= HIGH_END . An input line with values of zero for both G and N terminates the input.
- Postcondition:
incomeData[G - LOW_END] = total number of people with an income in the G -thousand-dollar group. The values read are displayed. If either G or N is erroneous (either G < LOW_END , G > HIGH_END , or N < 0 ), the function ignores the data line and continues.
- Returns:
- Returns
false if either G or N are erroneous (either G < LOW_END , G > HIGH_END , or N < 0 ) for any data line read. In this case, the calling program should take action. The return value is true if the data is error free.
Definition at line 37 of file c01p050.cpp.
References HIGH_END, index(), and LOW_END. |