Question: 4 . a . Example 8 - 8 defined theclassPersonto store the name of a person.The methods that we included merely set the name and

4. a.Example 8-8 defined theclassPersonto store the name of a person.The methods that we included merely set the name and print the nameof a person. Redefine theclassPersonso that, in addition to what theexistingclassdoes, you can:i.Set the last name only.ii.Set the first name only.iii.Set the middle name.iv.Check whether a given last name is the same as the last name of thisperson.v.Check whether a given first name is the same as the first name ofthis person.vi.Check whether a given middle name is the same as the middlename of this person.b.Add the methodequalsthat returns true if two objects contain thesame first, middle, and last name.c.Add the methodmakeCopythat copies the instance variables of aPersonobject into anotherPersonobject.d.Add the methodgetCopythat creates and returns the address of theobject, which is a copy of anotherPersonobject.e.Add the copy constructor.f.Write the definitions of the methods of theclassPersonto implementthe operations for thisclass.g.Write a program that tests various operations of theclassPerson.

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!