Problem

Example 12-9 defined a class personType to store the name of a person. The member functi...

Example 12-9 defined a class personType to store the name of a person. The member functions that we included merely print the name and set the name of a person. Redefine the class personType so that, in addition to what the existing class does, you can:

a. Set the first name only.

b. Set the first name only.

c. Store and set the middle name.

d. Check whether a given first name is the same as the first name of this person.

e. Check whether a given last name is the same as the last name of this person.

Write the definitions of the member functions to implement the operations for this class. Also, write a program to test various operations on this class.

Reference Example 12.9:

The most common attributes of a person are the person’s first bane and last name. The typical operations on a persons name are to set the name and print the name. The following statements define a class with these properties:

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 12
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT