Question 10 Print Person1 S Kids Apply Incnumkids Function Print Outputting Text End Line Q28864061

QUESTION 10 Print person1s 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 <iostream> using namespace std; class Personlnfo public: void SetNumKids(int personsKids); void IncNumKids) int GetNumKids() const; private int numKids; void Personlnfo:SetNumKids(int personsKids) numKids-personsKids; return; void Personlnfo::IncNumKids(){ numKids = numKids + 1 ; return; int Personlnfo::GetNumKids const return numKids; int main(0 Personlnfo person1; person1.SetNumKids(3); /* Your solution goes here*/ return 0; a. cout << Kids: < person1.GetNumKids () <<endl; person1.lncNumKids (); cout <New baby, kids now: << person1.GetNumKids () <endl; b. cout<<Kids: << person1.GetNumKids ) <endl; person1.lncNumKids () cout << New baby, kids now: << person1.GetNumKids ()<<endl; c. cout<< Kids: 3 <<end person1.lncNumKids (); cout << New baby, kids now: 4 <<endl;; d. cout << Kids: <<person1.GetNumKids () <endl; person1.lncNumKids (); cout << New baby, kids now: << person1.GetNumKids ()<<endl

QUESTION 10 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 Personlnfo public: void SetNumKids(int personsKids); void IncNumKids) int GetNumKids() const; private int numKids; void Personlnfo:SetNumKids(int personsKids) numKids-personsKids; return; void Personlnfo::IncNumKids(){ numKids = numKids + 1 ; return; int Personlnfo::GetNumKids const return numKids; int main(0 Personlnfo person1; person1.SetNumKids(3); /* Your solution goes here*/ return 0; a. cout Show transcribed image text

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *