Basically I have no idea what I did wrong here. The assignment:
Write a program to do the following:
Prompt for input of someone's first, middle, and last name as a single string (using any combination of upper and lowercase letters).
Check to make sure the name was entered in the correct format (3 names separated by spaces). If the input is not correct, continue to request the input again until the format is correct.
Capitalize only the first letters of each part of the name, and print out the revised name.
Print out the initials for that name.
Print out the name in the format of: Lastname, Firstname, MI. (for example: Smith, John A.).
Note: You must use the substring method, and you cannot utilize arrays or use StringTokenizer to accomplish this.
public class Name
public static void main(String args)
Scanner input = new Scanner (System.in);
int blankSpace = 0;
boolean good = false;
System.out.print("Enter your name as 'First Middle Last': ");
String aString = input.nextLine();
stringLength = aString.length();
blankSpace = 0;
for (int i = 0; i < stringLength; i++)
char ch = (aString.charAt(i));