// class for storing an item with a name and a price #ifndef ITEM_H #define ITEM_H #include #include using namespace std; class item { public: // constructs an item with the given name and price item(string item_name, double item_price); // returns the name of the item const string & get_name() const; // returns the price of the item double get_price() const; // returns a string representation of the item string to_string() const; // apply the given discount to the price void discount(double percent); private: string name; double price; }; // overloaded << operator ostream & operator<<(ostream & out, item i); // overloaded < operator bool operator<(const item & lhs, const item & rhs); #endif