Question: C++ Create the interface for a Rectangle class with one constructor that accepts two int parameters (width, height), has one public function area that returns
C++
Create the interface for a Rectangle class with one constructor that accepts two int parameters (width, height),
has one public function area that returns the area of the rectangle, and one private function calculate_area
that calculates area of the rectangle. The class has 3 int private variables area, width, and height.
*/
Create a vector of rectangles
Add 3 Rectangle classes to the vector:
Width Height Area
4 5 20
10 10 100
100 10 1000
Iterate the vector and display the Area for each Rectangle on one line and the total area for the
3 rectangles.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
