|
|
|
|
|
|
|
return 0;
}
//******************************************************************
void PrintHeading()
// Prints the title for the bar chart, a heading, and the numeric
// scale for the chart. The scale uses one mark per $500
// Postcondition:
// The heading for the bar chart has been printed
{
cout
<< Bar Graph Comparing Departments of Store #1 and Store #2
<< endl < endl
< Store Sales in 1,000s of dollars < endl
< # 0 5 10 15 20 25
< endl
< |.........|.........|.........|.........|.........|
< endl;
}
//******************************************************************
void GetData( /* inout */ ifstream& dataFile, // Input file
/* out */ int& deptID, // Department number
/* out */ float& deptSales ) // Department's
// monthly sales
// Takes an input accounting file as a parameter, reads the
// department ID number and number of days of sales from that file,
// then reads one sales figure for each of those days, computing a
// total sales figure for the month. This figure is returned in
// deptSales. (If input of any of the department's data fails
// due to end-of-file, deptID and deptSales are undefined.)
// Precondition:
// dataFile has been successfully opened
// Postcondition:
// IF input of any of the department data failed
// deptID and deptSales are undefined
// ELSE
// The data file reading marker has advanced past one
// department's data
// && deptID == department ID number as read from the file
|
|
|
|
|
|