Question: Consider the Rectangle class definition below. Make all the necessary changes to make the largest() function template work with Rectangle types in a meaningful way.
Consider the Rectangle class definition below. Make all the necessary changes to make the largest() function template work with Rectangle types in a meaningful way.
c++

1 /k k Declaration Section * 2 class Rectangle ( 3 private: 4 5 public: int width, length; Rectangle (); Rectangle(int w, int 1); Rectangle operator+(Rectangle& r); 10 k* Implementation Section 11 Rectangle :: Rectangle) [ width - 1, length - 2; ] 12 Rectangle :: Rectangle (int w, intl)width - w, length - 1; 13 Rectangle Rectangle :: operator+(Rectangle& r) 14 15 Rectangle temp; temp. width - this ->width + r.width; temp.length - this ->length + r.length; return temp; 17 18 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
