Create a person class to represent a person


Discussion:

Q: Create a program that does the following:

Create a person class to represent a person. (Call the class personType.) To simplify things, have the class have 2 variable members for the person's first and last name. Include 2 constructors. One should be a default constructor and the other should be one with parameters.

Include respective functions for:

•setting the name,

• getting the name, and

•printing the name on the screen.

Have the main program call these functions to demonstrate how they work. Also, if you could help to explain to me how both constructors can be replaced with one constructor by using a single constructor with default parameters.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create a person class to represent a person
Reference No:- TGS01936610

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)