Consider the following class implementation, which represents a price in dollars and cents: class Price { private: int dollars; int cents; public: Price() { dollars = cents = 0; } Price(int d, int c)...


Consider the following class implementation, which represents a price in dollars and cents:


class Price


{


private:


  int dollars;


  int cents;


public:


  Price() { dollars = cents = 0; }


  Price(int d, int c) { dollars = d; cents = c; }


  bool operator!=(Price);


  bool operator<>


};





Write an implementation for both overloaded operators.  != should return true if the Prices are not equivalent, and should return false if they are equivalent.< should="" return="" true="" if="" the="" price="" of="" the="" calling="" object="" (left="" object)="" is="" less="" than="" the="" parameter="" price="" object="" (right="" object). ="" you="" do="" not="" need="" to="" demonstrate="" calling="" these="">




Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here