1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
int main()
{ int index = 13;
double sales[index],
sum = 0;
ifstream inFile;
ofstream outFile;
open_files(inFile, outFile);
sales_data(index, sales, inFile);
total_sales(index, inFile, outFile);
minmax_amount(index, sales, inFile, outFile);
sales_sort(index, sales, inFile, outFile);
sales_sum(index, sales, sum, inFile, outFile);
inFile.close();
outFile.close();
return 0;
}
void sales_data(int index, double sales[], ifstream& inFile) //storing data in an array
{
if(!inFile.eof())
{
for(int i = 0; i < index; i++)
{
inFile >> sales[i];
}
}
}
|