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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started