The class Name given represents a person’s first and last names. Derive the class ProperName from Name, adding data fields for a middle initial and a title such as Ms., Mrs., Mr., or Dr. Provide...


The class Name given represents a person’s first and last names. Derive the class ProperName from Name, adding data fields for a middle initial and a title such as Ms., Mrs., Mr., or Dr. Provide reasonable constructors and set and get methods for the new fields. Override the toString method so that it behaves correctly for the new class.


Explain why inheritance is appropriate in the definition of ProperName but would not be a reasonable choice for the definition of the class NickName.



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here