Question: #include // Include the Rectangle.h file #include Rectangle.h using namespace std; int main() { //Create Rectangle object r1 using Constructor that does not take any

#include

// Include the Rectangle.h file #include "Rectangle.h"

using namespace std;

int main() { //Create Rectangle object r1 using Constructor that does not take any arguments. //NOTE how the object is created without passing any values. Rectangle r1;

//Now Create Rectangle object r2 using Constructor that takes two integer arguments (2,2). //You need to use CONSTRUCTOR 2 defined in Rectangle.cpp and it takes two arguments Rectangle r2(2,2);

//Lets print the details of Rectangles r1 and r2 //Notice how we use the get functions to get the length and width of the rectangle cout<<"Rectangle r1 details: r1[length="<

//Lets print the Perimeter of Rectangle r1 cout<<"Rectangle r1 Perimeter = "<

//Lets print the area of Rectangle r1 cout<<"Rectangle r1 Area = "<

// Define 2 integer variables length and width and take them as input from user. //--> cout << "Please enter the length of the first rectangle: "; //--> cout << "Please enter the width of the first rectangle: "; //-->

//lets change the length and width of rectangle r1 from [0,0] to [length,width] // Change the length of r1 to r1.setLength(length); //Change the width of r1 to r1.setWidth(Width);

//Lets the print the new details of Rectangle r1 cout<<"Rectangle r1 details: r1[length="<//Calculate the new Perimeter of r1 and print it //--> //Calculate the new area of r1 and print it //-->

//Lets use the isSquare() function to check if the Rectangles r1 and r2 are squares if(r1.isSquare()) cout<<"Rectangle r1 is a square "; else cout<<"Rectangle r1 is NOT a square ";

//Check if Rectangle r2 is a square and print if it so (similar to above) if(r2.isSquare()) cout<<"Rectangle r2 is a square "; else cout<<"Rectangle r2 is NOT a square ";

return 0; }

Please complete the bolded parts.

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!