subject

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#includeusing 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); this-> numkids = numkids; return 0; }2) define the missing function. licensenum is created as: (1 * customid) + licenseyear. sample output: dog license: 77702014#includeusing 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()/* your solution 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; }3) define a constructor as indicated. sample output for below program: year: 0, vin: -1year: 2009, vin: 444555666#includeusing namespace std; class carrecord { public: void setyearmade(int originalyear); void setvehicleidnum(int vehidnum); void print() const; carrecord(); private: int yearmade; int vehicleidnum; }; // fixme: write constructor, initialize year to 0, vehicle id num to -1./* your solution goes here */void carrecord: : setyearmade(int originalyear) { yearmade = originalyear; return; }void carrecord: : setvehicleidnum(int vehidnum) { vehicleidnum = vehidnum; return; }void carrecord: : print() const { cout < < "year: " < < yearmade < < ", vin: " < < vehicleidnum < < endl; return; }int main() { carrecord familycar; familycar. print(); familycar. setyearmade(2009); familycar. setvehicleidnum(444555666); familycar. print(); return 0; }4) write a second constructor as indicated. sample output: user1: minutes: 0, messages: 0user2: minutes: 1000, messages: 5000#includeusing namespace std; class phoneplan{ public: phoneplan(); phoneplan(int numminutes, int nummessages); void print() const; private: int freeminutes; int freemessages; }; phoneplan: : phoneplan() { // default constructor freeminutes = 0; freemessages = 0; return; }// fixme: create a second constructor with numminutes and nummessages parameters./* your solution goes here */void phoneplan: : print() const { cout < < "minutes: " < < freeminutes < < ", messages: " < < freemessages < < endl; return; }int main() { phoneplan user1plan; // calls default constructor phoneplan user2plan(1000, 5000); // calls newly-created constructor cout < < "user1: "; user1plan. print(); cout < < "user2: "; user2plan. print(); return 0; }

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
Which statement best explains how plant cells use photosynthesis to maintain homeostasis? they use glucose and water to make energy. they break down glucose into fat. they combine oxygen and water to make glucose. they make glucose from carbon dioxide and water.
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
Which of the following examples has four beats in each measure?
Answers: 2
question
Computers and Technology, 23.06.2019 03:50
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
Answers: 1
You know the right answer?
Print person1's kids, apply the incnumkids() function, and print again, outputting text as below. en...
Questions
question
Mathematics, 29.01.2021 07:00
question
Physics, 29.01.2021 07:00
question
Mathematics, 29.01.2021 07:00
question
Mathematics, 29.01.2021 07:00
question
Mathematics, 29.01.2021 07:00
Questions on the website: 13722363