int main () { ifstream orderfile, menufile int total = 0; int i; orderfile.open("order.dat"); menufile.open("menu.dat"); Print_Header(); i = 0; while (i++ < NumberOfSand) { ProcessSand(orderfile, menufile,total); } } ProcessSand(ifstream & orderfile, ifstream & menufile, int & total) { menufile >> SandName >> SandPrice >> Side1 >> Side2 orderfile >> SandQuant >> WantSide1 >> WandSide2 if (SandQuant > ) ) { cout << SandQuant << SandName print_sides(Side1, Side2, WantSide1, WantSide2); cout << SandQuant*SandPrice << endl; total = total + SandQuant*SandPrice; } }