Question: Write a class named Rectangle that has the following member variables 10. . length: an int . width: an int. . area: an int In
Write a class named Rectangle that has the following member variables 10. . length: an int . width: an int. . area: an int In addition, the class should have the following constructor and member functions A Constructor that accepts the 2 values. These values should be assigned to the object's . length and width. . A default constructor that sets the length and width to O. .Appropriate accessor and mutator methods . A calcArea method. The method will calculat e the area of the rectangle object. Declare the class here. This is the code you would put in Rectangle.h (only function prototypes) a. (10) b. Show the UML diagram for the Rectangle class described above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
