Question: Create a class in C + + called Person , as shown in Figure 1 ; within this class, you need to define the followings:
Create a class in Ccalled Person as shown in Figure ; within this class, you need to define the followings:
A Two private data members: age and name.
B Two constructors: the default constructor and the other, which is used to set the two data members.
C A SetPerson method to set the values of the class data members
D A Show method prints the persons name and age on the screen.
E Test your class by creating an object of it in the main function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
