In the following Rectangle class declaration, the width, length, and area members are of type double. Rewrite the class as a template that will accept any numeric type for these members.
class Rectangle
{
private:
double width;
double length;
double area;
public:
void setData(double w, double l)
{ width = w; length = l;}
void calcArea()
{ area = width * length; }
double getWidth()
{ return width; }
double getLength()
{ return length; }
double getArea()
{ return area; }
};
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.