Question: Can someone please help with this program!! It is in C++ and Microsoft Visual Studio. 1. (100 Points) Implement a Gen Rectangle class (i.e., Generic
Can someone please help with this program!! It is in C++ and Microsoft Visual Studio.


1. (100 Points) Implement a Gen Rectangle class (i.e., Generic Rectangle) that utilizes the following Private Data Fields/Public Methods int x 1/Upper left x coordinate for rectangle int y: //Upper left y coordinate for rectangle int width: //width of rectangle int height: 1/height of rectangle GenRectangle) /Default Construct- sets x to 100,y to 25,width to 20, height to 30 int getWidth( //Getter for width int getHeight I/Getter for height int getx): //Getter for x int getY) 1/Getter for y int getArea ) //Returns the area of Rectangle int getPerimeter () //Returns the perimeter of Rectangle void setwidth(int width); //Setter for width - Min 1 /Max 50 void setHeight (int height) I/Setter for Height - Min 1/ Max 50 void setx(int x); //Setter for x - Min 100/ Max 539 void setY (int y); //Setter for Y Min 25 Max 455 string getType() void draw)://Draws a hollow rectangle in the graphics window/Colors it based on rules The Default Constructor initializes x to 100, y to 25, width to 20, and the height to 30 The data validation rules for the setWidth/setHeight, setX/setY methods are to clip the input to the min/max values. For any value less than the minimum allowable value, set the private data field to the minimum value. For any value greater than the maximum allowable value, set the private data field to the maximum value. The maximum allowable value for x is 539. The minimum allowable value for x is 100 The maximum allowable value for y is 455. The minimum allowable value for y is 25 The maximum allowable value for width is 50. The minimum allowable value for width is 1 The maximum allowable value for height is 50. The minimum allowable value for height is getType0 returns a string containing either "SMALL RECTANGLE", "MIDDLE_RECTANGLE" or LARGE _RECTANGLE" based on the area. The following rules apply: SMALL_RECTANGLE MIDDLE_RECTANGLE LARGE_RECTANGLE Color rectangle red - (255,0,0) Color rectangle green-(0,255,0) Color rectangle blue -(0,0,255) 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
