Using C++, please answer both questions. Thank You.
Define a class Rectangle with two attributes: 1. length, an integer (default value 1) width, an integer (default value 1) Provide the following member functions: default constructor constructor that takes parameters used to initialize the data get/set function for each attribute a function perimeter() that returns the perimeter of the rectangle a function area() that returns the area of the rectangle Write a main program that uses the class Rectangle to create two rectangle objects with user input dimensions. The program compares the perimeters of the two rectangles and prints to the screen the area of the rectangle with the smallest perimeter (pick arbitrarily, if they are equal) 2. Show transcribed image text Define a class Rectangle with two attributes: 1. length, an integer (default value 1) width, an integer (default value 1) Provide the following member functions: default constructor constructor that takes parameters used to initialize the data get/set function for each attribute a function perimeter() that returns the perimeter of the rectangle a function area() that returns the area of the rectangle Write a main program that uses the class Rectangle to create two rectangle objects with user input dimensions. The program compares the perimeters of the two rectangles and prints to the screen the area of the rectangle with the smallest perimeter (pick arbitrarily, if they are equal) 2.
Expert Answer
Answer to Define a class Rectangle with two attributes: 1. length, an integer (default value 1) width, an integer (default value 1…