Question: This lab has been designed for you to practice implementing and testing overloaded operators for a Rectangle class. The 0 5 _ Rectangle project contains

This lab has been designed for you to practice implementing and testing overloaded operators for a Rectangle class. The 05_Rectangle project contains the following Rectangle class in the "Rectangle. h" file.
class Rectangle {
private:
unsigned width, length_;
public:
Rectangle();
(1) Mutator
void setwidth(unsigned);
void setLength(unsigned);
Accessor
double area() const;
string to_string() const;
The width_ and length_data members represent the width and length of a Rectangle shape.
You are given the following member functions:
The default constructor sets the width and length of a new Rectangle object to 5 and 10, respectively.
A setwidth member function that takes one parameter and updates the width of the invoking Rectangle object using the value of the parameter.
A setLength member function that takes one parameter and updates the length of the invoking Rectangle object using the value of the parameter.
An area member function returns the area of the invoking Rectangle object.
A to_string member function returns a string that includes the width and length of the invoking Rectangle object.
In part I, you are asked to overload some operators for the Rectangle class using member functions. Make sure to write their prototypes in the "Rectangle. h" file, implement them in the "Rectangle.cpp" file, and test them in the "main.cpp" file.
 This lab has been designed for you to practice implementing and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!