#ifndef _GROCERY #define _GROCERY #include "IOMgmt.h" using namespace IOMgmt; class Grocery { public: Grocery(); //Default constructor Grocery( ifstream& fin ) throw(TokenError); //Boundary constructor Grocery( string Name, double Markup, int Cost ); //Parametric constructor string getName() const; //Inspector int getCost() const; //Inspector double getMarkup() const; //Inspector int getPrice() const; //Property = ceil(cost*markup) virtual void Extract(ifstream& fin )throw(TokenError); //Boundary input virtual void Insert( ostream& fout ); //Boundary output friend ifstream& operator>>(ifstream& fin, Grocery& obj) throw(TokenError); friend ostream& operator<<(ostream& fout, Grocery& obj); protected: virtual void Get( ifstream& fin) throw(TokenError); //Boundary input virtual void Put( ostream& fout); //Boundary output private: string name; double markup; // must be non-negative (1.0 = no profit) int cost; // unit cost in cents };//Grocery #endif