Question: Need help with cmputer science question to create a rectangle. Version 0 and Version 1 are there to help step by step but only Version
Goal: Working with Classes Version Q Create a class Rectangle with atributes length and width each of which defaults to 1 Provide member functions that calculate the perimeter and the area of the rectangle Provide set and get functions for the length and mm anbAn The "func em should venity that length and width are each floating-point numbers larger than 0 0 and ess than 20.0 Fles created rectangle.cpp, rectangle h, rectangle test.epp, maincpp Version 1 Create a more sophisticated Rectangle class than the one you created above. This class stores only the Cartesian coordinates of the four coners of the rectangle. The constructor calls a set unction that accepts four sets of coordinates and venifes that each of these is in the first quadrant with no single x- or y-coordinate larger than 20 0. The set function also verifies that the supplied coordinates do, in fact specily a rectangle Provide member functions that calculate the length width perimeter and area. The ength is the larger of the two dimensions Idude a predicate function saa e that determines eer te rectangle is a square. Version 2 Modify class Rectangle from above to include a draw function that displays the rectangle inside a 25-by- 25 box enclosing the portion of the first quadrant in which the rectangle resides Include a setFilCharacter function to specity the character out of which he body of the rectangle wil be drawn. Include a setPerimeterCharacter function to specily the character that will be used to draw the border of the rectangle Extra Credit (up to 20 points): If you feel ambitious, you might include functions to scale the size of the rectangle, rotate it, and move it around within the designated portion of the first quadrant Submit Version-2 with files rectangle.cpp, rectangleh zectangle ceat.app ain.epp to Canvas
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
