Question: C++ 2. (Rectangles) Write a function ClassifyRects) with the following parameters: int 1D array Rect1, and int 1D array Rect2. Th two points (x1, y1)

C++  C++ 2. (Rectangles) Write a function ClassifyRects) with the following parameters:
int 1D array Rect1, and int 1D array Rect2. Th two points

2. (Rectangles) Write a function ClassifyRects) with the following parameters: int 1D array Rect1, and int 1D array Rect2. Th two points (x1, y1) and (x2, y2) that define Rectangle #1. The four value in the array Rect2 are the two points (a1, b1) and (a2, b2) that define Rectangle #2. The function should return the following values based on these criteria: 1) Th e size of each array is 4. The four values in the array Rect1 are the e function will return 1:if both rectangles are square and have the same side lengths ) The function will return 2: if both rectangles are square but have different side lengths 3) The function will return 3:if one of the rectangle is a square and one is a rectangle. 4) The function will return 4: if both rectangles are not squares but have the same area. S) The function will return 5:if both rectangles are not square and have a different area. Write a function DisplayRects() with the integer parameter response. The function will display the following based on the value of the response. 1) Response is 1: "Both rectangles are squares with the same side lengths" 2) Response is 2: "Both rectangles are squares with different side lengths" 3) Response is 3: "One is a rectangle, other is a square 4) Response is 4: "Both are rectangles with the same area" 5) "Both are rectangles with different areas" The main() is provided. You will need to implement the two functions. int main() int Rect1[4], Rect2[4], response; cout

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!