#include using namespace std; class fraction { protected: int top, bot; public: fraction(int t, int b) { top = t; bot = b; } void examine() { cout << "this object lives at " << this << "\n"; cout << "its top lives at " << & top << "\n"; cout << "its bot lives at " << & bot << "\n"; } void print(ostream & out) { out << top << "/" << bot << "\n"; } fraction mul(fraction other) { return fraction(top * other.top, bot * other.bot); } }; int main() { fraction a(1, 4), b(3, 7); a.mul(b).print(cout); a.examine(); }