Question: Step 1: Person Class Define a base class called Person. The class should have two data members to hold the first name and last name

Step 1: Person Class

Define a base class called Person. The class should have two data members to hold the first name and last name of a person, both of type string.

The Person class will have a default constructor to initialize both data members to empty strings, a constructor to accept two string parameters and use them to initialize the first and last name, and a copy constructor. Also include appropriate accessor and mutator member functions. Overload the operators == such that two objects of class Person are considered equal if and only if both first and last names are equal. Overload the assignment operator = such that one object of Person can be copied to another Person object.

Also overload operators >> and <<.

The definition of Person class follows:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!