Explore BrainMass
Share

C++ class

This content was STOLEN from BrainMass.com - View the original, and get the solution, here!

I need help to 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.

© BrainMass Inc. brainmass.com September 26, 2018, 4:38 am ad1c9bdddf - https://brainmass.com/computer-science/cpp/c-class-567441

Solution Summary

define a person class using c++

$2.19