/**
 * Models a person's name
 */
public class Name
{
    private String first;
    private String middle;
    private String last;

    /**
     * Constructs a Name given first,middle, 
     * and last names
     * @param theFirst the first name  in the Name
     * @param theMiddleInitial the middle inital in 
     * the Name
     * @param theLast the last name in the Name
     */
    public Name(String theFirst, String theMiddleInitial, String theLast)
    {
        first = theFirst;
        middle = theMiddleInitial;
        last = theLast;
    }

    /**
     * Constructs a Name given first,middle, 
     * and last names
     * @param theFirst the first name  in the Name
     * @param theLast the last name in the Name
     */
    public Name(String theFirst, String theLast)
    {
        first = theFirst;
        middle = "";
        last = theLast;
    }

    /**
     * Gets the first name of this Name
     * @return the first name of this Name
     */
    public String getFirst() 
    {
        return first;
    }

    /**
     * Gets the middle initial name of this Name
     * @return the middle initial name of this Name
     */
    public String getMiddleInitial() 
    {
        return middle;
    }

    /**
     * Gets the last name of this Name
     * @return the last name of this Name
     */
    public String getLast() 
    {
        return last;
    }

    /**
     * Gets the number of characters in the full name 
     * - not counting spaces
     * @return the number of characters in the full name 
     * - not counting spaces
     */
    public int numberOfCharacters()
    {
        return first.length() + middle.length()
        + last.length();
    }

    /**
     * Gets the full name with spaces 
     * separating the names
     * @return the full name with spaces separating the names
     */
    public String getFullName() 
    {
        return first + " " + middle + " " 
        + last;
    }

    /**
     * Gets the initials of this Name (first 
     * inital, middle inital, last initial)
     * with no spaces
     * @return the initials of this Name
     */
    public String getInitials() 
    {
        return first.substring(0,1) + middle 
          + last.substring(0,1);

    }
}
