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 using namespace std;

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

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!