//maincat.cpp enum {end='0', basecard='c', book='b', journal='j'}; #include //endl #include //ifstream, ofstream using namespace std; #include"card.h" int main() { card * cardlist[10]; ifstream myin("somecards.txt"); ofstream myout("nicelook.txt"); int i=0; char type; myin >> type; myin.ignore(80,'\n'); while (type != end && i<10) { switch (type) { case basecard: cardlist[i]=new card; break; case book: cardlist[i]=new book_card; break; case journal: cardlist[i]=new journal_card; break; } //end switch cardlist[i]->read(myin); //polymorphism at work i++; myin>>type; myin.ignore(80,'\n'); } int j; for (j=0; jdisplay(myout) << endl; //polymorphism again } //*** should delete all the cards *** //must be deleted one by one for (j=0; j