Question: Write a program that calculates the area and keeps a count that how many times it has calculated the area. 1. Create a class area

Write a program that calculates the area and keeps a count that how many times it has calculated the area.

1. Create a class area that has data members of length, width, and area (int type).
2. It also has a static int member count, initialize it with zero.
3. Overload constructor of class and calculate area in it, pass the values of length and width from main. (calculate the area three times).
4. Create a static member function in class which tells that how many times area has been calculated. (This function will return the value of count when called)
5. Write the function of display and display the area along with the value of count.


C++ OOP

Kindly use double pointers.

Step by Step Solution

3.36 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

include using namespace std static i... View full answer

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 Programming Questions!