Question: The lab has been designed for you to pructice implementing and testing overlesded operators for a enc. cheste pectangle x privatest unstgend width _ .
The lab has been designed for you to pructice implementing and testing overlesded operators for a enc.
cheste pectangle
privatest
unstgend width lengthi
pebuthe:
Recterentoli:
x
vopd setwidthunsigned:
voud sectengthi uns Conedi:
coputhe aneac const:
ptring tostring const:
The width, and length data members represent the width and length of a Rectangle shape.
You are given the following member functions:
The delault constructor sets the with and length of a new Rectangle object to and Fespectively.
A setwideh member function that takes cone parameter and updates the width of the involing Rectang le object using the value of the parameter.
A settength menber function that takes one parameter and updates the length of the invoking Rectanglo object using the value of the parameter.
An area member function rotums the area of the invoking fectangle object.
A tostring member function returns a string that indudes the wdith and length of the invoking Rectangle object
In part h you are asked wo overioid some operators for the Rectangle class using member functions. Make sure to write their prototyper in the "Rectangle the, implement them in the "Rectanglecpp" fle, and test them in the "main cpp ith"
Overtoad heeeperator to compare two Rectangle objects, it shall return true if the two rectunghe ore congruent and fake ottierwise. Two rectangles are congruent if they can hawe the firct rectingle is the same ac the length of the second and the length of the first is the same as the Widthol the cerond, For example, rectangle is cougruent with a rectangle. The tollowing tilutrates the rerults of cone cample tertang:
fitet rectingle: Mmanctore sy by
Goipare tint with secend true
Coppare sechen uth thind false Uniphed value. The folowing Hustates the foxuts of weme sumple terting.
instup
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
