public Name(String first, String middle, String last)
-- constructor.
The name should be stored in the case given; don't convert to all upper
or lower case. public String getFirst()
-- returns the first name public String getMiddle()
-- returns the middle name public String getLast()
-- returns the last name public String firstMiddleLast()
-- returns a string containing
the person's full name in order, e.g., "Mary Jane Smith". public String lastFirstMiddle()
-- returns a string containing
the person's full name with the last name first followed by a comma, e.g.,
"Smith, Mary Jane". public boolean isEqual(Name otherName)
-- returns true if
this name is the same as otherName. Comparisons should not be case sensitive.
(Hint: There is a String method equalsIgnoreCase that is just like
the String method equals except it does not consider case in doing
its comparison.) public String initials()
-- returns the person's initials
(a 3-character string). The initials should be all in upper case, regardless
of what case the name was entered in. (Hint: Instead of using charAt,
use the substring method of String to get a string containing only
the first letter -- then you can upcase this one-letter string. (See Chapter 1 in the text, pp. 39-40, for a description of the substring method. Or see this page.) public int length()
-- returns the total number of characters
in the full name, not including spaces. Your lab document should contain sample output of your program where the two names are the same, and then when the two names differ.
Submit a zip file, names.zip, consisting of your lab document and the Name.java and TestNames.java files.