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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 15 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply