Question
Print person1's kids, apply the IncNumKids() function, and print again, outputting text as below. End each line with newline. Sample output for below program: Kids:
Print person1's kids, apply the IncNumKids() function, and print again, outputting text as below. End each line with newline. Sample output for below program: Kids: 3 New baby, kids now: 4 #include class PersonInfo { public: void SetNumKids(int personsKids); void IncNumKids(); int GetNumKids() const; private: int numKids; }; void PersonInfo::SetNumKids(int personsKids) { numKids = personsKids; return; } void PersonInfo::IncNumKids() { numKids = numKids + 1; return; } int PersonInfo::GetNumKids() const { return numKids; } int main() { PersonInfo person1; person1.SetNumKids(3); //SOULTION GOES HERE// return 0; }
--------------------------------------------------------------------------------------------------------------------- Define the missing function. licenseNum is created as: (100000 * customID) + licenseYear. Sample output: Dog license: 77702014 #include class DogLicense{ public: void SetYear(int yearRegistered); void CreateLicenseNum(int customID); int GetLicenseNum() const; private: int licenseYear; int licenseNum; }; void DogLicense::SetYear(int yearRegistered) { licenseYear = yearRegistered; return; } // FIXME: Write CreateLicenseNum() //SOULTION GOES HERE// int DogLicense::GetLicenseNum() const { return licenseNum; } int main() { DogLicense dog1; dog1.SetYear(2014); dog1.CreateLicenseNum(777); cout << "Dog license: " << dog1.GetLicenseNum() << endl; return 0; } |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started