As the following Rectangle class is written, the width and length members are doubles
Chapter 16, Problem 16.11(choose chapter or problem)
As the following Rectangle class is written, the width and length members are doubles. Rewrite the class as a template that will accept any data type for these members. class Rectangle { private: double width; double length; public: void setData(double w, double l) { width = w; length = l;} double getWidth() { return width; } double getLength() { return length; } double getArea() { return width * length; } };
Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.
Becoming a subscriber
Or look for another answer