Question: Write a main program which must includes a minimum of 10 test cases to exercise the copy constructor and the overloaded operators /7 class counter

 Write a main program which must includes a minimum of 10test cases to exercise the copy constructor and the overloaded operators /7

Write a main program which must includes a minimum of 10 test cases to exercise the copy constructor and the overloaded operators

/7 class counter header file pcounter.h #ifndefPCOUNTERH - - #define -PCOUNTER_A Taclass to hold a pointer to an integer counter class Counter public // constructors Counter(int k); Counter(const Counter& rhs); 7/ copy constructor overloading operators Counter& operator-(const Counter& rhs); // overloading of operator +-,-, and *= Counter& operator+(const Counter& rhs); Counter& operator--(const Counter& rhs); Counter& operator*-(const Counter& rhs); // overloading of binary operator +,-, * Counter operator+(const Counter& rhs) const; Counter operator-(const Counter& rhs) const; Counter operator (const Counter& rhs) const; // overloading of comparison operators-and != bool operator(const Counter& rhs) const; bool operator!-(const Counter& rhs) const; increment and decrement functions void incrementO; void decrementO; // get function int getCountO const; //destructor CounterO; private int* _p; // holds the pointer to a dynamically allocated integer count #endif //-PCOUNTER. H

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!