Question: Classes: 8. Use the following class declaration to answer parts a -f Ilclass declaration section class Person private: string firstname string lastmame: char middleinit: int
Classes: 8. Use the following class declaration to answer parts a -f Ilclass declaration section class Person private: string firstname string lastmame: char middleinit: int age; public: Person (string, string, char, int; void setfirst(string); void setlast(string); void setmid(char); void setage(int: string showname0 sonst: string showage0 const liclass client section Person a, b ("Mary", "Jones", 'L', 25); int age-30; string first "John", last "Brown" char initial; a.setfirstffirst); a.astlast(second); aastmid(initial); a.sctagelage); a.shownameD bshowage0; a List all of the identifiers that are names of class members. a. set List all of the identifiers that are names of class instances (objects). List the names of all member functions that are allowed to modify the private data. b. c. d Which function is the constructor for this class? e. Assuming that the shownamc0 function outputs the name in the private portion of the class, what would b.shonams output? What would a.shewnamc output? f. Would it be valid to use a.firstname in the client code? Why or why not
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
