(Solved) : Define Class Rectangle Two Attributes 1 Length Integer Default Value 1 Width Integer Defau Q42652583 . . .

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) Pro

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…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us