#include #include #include using namespace std; #include "Grocery.h" #include "Produce.h" int main() { InMgr finMgr("Enter name of Input file:"); ifstream& fin = finMgr.getStream(); OutMgr foutMgr("Enter name of Output file:"); ostream& fout = foutMgr.getStream(); try{ Grocery g1( fin ),g2,g3; Produce p1( fin ),p2,p3; g2.Extract( fin ); p2.Extract( fin ); fin >> g3 >> p3; g3.Insert( fout ); g2.Insert( fout ); g1.Insert( fout ); fout << endl << "End of Grocery Instances" << endl; fout << p3 << p2 << p1 << endl; fout << "End of Produce Instances" << endl; } catch(TokenError e) { fout << e.getMsg() << endl; fout << e.getOrigin() << endl; } finMgr.close(); foutMgr.close(); return 0; }//main