Question: Define the missing member function. Use this to distinguish the local member from the parameter name. #include using namespace std; class CablePlan{ public: void SetNumDays(int
Define the missing member function. Use "this" to distinguish the local member from the parameter name.
#include
class CablePlan{ public: void SetNumDays(int numDays); int GetNumDays() const; private: int numDays; };
// FIXME: Define SetNumDays() member function, using "this" implicit parameter. void CablePlan::SetNumDays(int numDays) {
/* Your solution goes here */
}
int CablePlan::GetNumDays() const { return numDays; }
int main() { CablePlan house1Plan; int userNum;
cin >> userNum; house1Plan.SetNumDays(userNum); cout << house1Plan.GetNumDays() << endl;
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
