(Enhancing Class Rectangle) Create a more sophisticated Rectangle class than the one youcreated in Exercise 17.11. This class stores only the Cartesian coordinates of the four corners of therectangle. The constructor calls a set function that accepts four sets of coordinates and verifies thateach 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, specify a rectangle. Provide member functions that calculate the length, width, perimeter and area. The length is the larger of the twodimensions. Include a predicate function square that determines whether the rectangle is a square
(Enhancing Class Rectangle) Create a more sophisticated Rectangle class than the one you
created in Exercise 17.11. This class stores only the Cartesian coordinates of the four corners of the
rectangle. The constructor calls a set function that accepts four sets of coordinates and verifies 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, specify a rectangle. Provide member functions that calculate the length, width, perimeter and area. The length is the larger of the two
dimensions. Include a predicate function square that determines whether the rectangle is a square
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images