public class Initials {
	// get the first and last initials of a name
	public static String twoInitials(String name) {
		String result = ""; // start with empty string
		result += firstInitial(name); // append first initial
		result += lastInitial(name); // append last initial
		return result; // we're done!
	}

	// get the first initial of a name
	public static char firstInitial(String name) {
		char result = name.charAt(0);
		return result;
	}

	// get the last initial of a name
	public static char lastInitial(String name) {
		int indexOfSpace = name.lastIndexOf(' ');
		return name.charAt(indexOfSpace + 1);
	}

}
