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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!