Page 1 of 1

CHALLENGE ACTIVITY Define the missing member function. Use "this" to distinguish the local member from the parameter nam

Posted: Sun Jul 03, 2022 9:58 am
by answerhappygod
Challenge Activity Define The Missing Member Function Use This To Distinguish The Local Member From The Parameter Nam 1
Challenge Activity Define The Missing Member Function Use This To Distinguish The Local Member From The Parameter Nam 1 (56.61 KiB) Viewed 17 times
#include <iostream>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;}
CHALLENGE ACTIVITY Define the missing member function. Use "this" to distinguish the local member from the parameter name. 397756.2392630.qx3zqy7 10.13.2: The this implicit parameter. 1 #include <iostream> 2 using namespace std; 3 4 class CablePlan { 5 6 7 8 9 10 }; 11 12 // FIXME: Define SetNumDays () member function, using "this" implicit parameter. 13 void Cable Plan: :SetNumDays (int numDays) { 14 /* Your solution goes here */ 15 16 17} 18 Run public: void SetNumDays (int numDays); int GetNumDays () const; private: int numDays; 1 tast passed All tests assa