Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago