Question: Add two new methods to the Name class: public String getNormalOrder() Returns the persons name in normal order, with the first name followed by the

Add two new methods to the Name class:

public String getNormalOrder()

Returns the person’s name in normal order, with the first name followed by the middle initial and last name. For example, if the first name is "John", the middle initial is "Q", and the last name is "Public", returns "John Q. Public".

public String getReverseOrder()

Returns the person’s name in reverse order, with the last name preceding the first name and middle initial. For example, if the first name is "John", the middle initial is "Q", and the last name is "Public", returns "Public, John Q.".


Data from Problem 7

Create a class called Name that represents a person’s name. The class should have fields representing the person’s first name, last name, and middle initial. (Your class should contain only fields for now.)

Step by Step Solution

3.37 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Name class with two methods A Name object represents a name such as John Q Public p... View full answer

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 Building Java Programs A Back to Basics Approach Questions!