Question: Given the following class: class person public: private: void setName (string); void setAge (int); string getName(); int getAge() void print Person (): person (atring

Given the following class: class person public: private: void setName (string); void setAge (int); string getName(); int getAge() void print Person (): person (atring alame, int anAge); string name: int age: 31 // Clans Declaration //setAge, setllame, getAge, getName and person are implemented, but not shown Write the print Person function in the person class so that the output looks as the following xxxxx is an adult or xxxx is a teenager dr xoxox is a child where xoxx is the person object's name If the person is 20 years or older, then the person is an adult if the person is 13-19 years, then the person is a teenager otherwise the person is a child. Note: printferson() is a function inside the person class, it should be able to access all private members directly. Please don't forget out the scope resolution prefix before the function name, TTTT Para
Step by Step Solution
3.38 Rating (157 Votes )
There are 3 Steps involved in it
the implementation of the printPerson function in the per... View full answer
Get step-by-step solutions from verified subject matter experts
