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.49 Rating (159 Votes )
There are 3 Steps involved in it
calculateAreacpp include using namespace std class calculateArea ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
608c00a35c727_206485.pdf
180 KBs PDF File
608c00a35c727_206485.docx
120 KBs Word File
