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 //Lets the print the new details of Rectangle r1 cout<<"Rectangle r1 details: r1[length="< //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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started