Hi, one of my labs were doing is a data gatherer, the user enters their first middle and last name all at once with a space between each. then enters there birth month day and year all at once with space between each. Then it outputs them in in a table like fashion with
a each piece having a header... looks like this
First Middle Last
joe frank bob
Day Year Month
1 2010 january
the directions say to use /n /t to align the table properly.... ok so heres MY code
Scanner sc = new Scanner(System.in);
System.out.print("Enter your first, middle, and last name with a space between each: ");
String name = sc.nextLine();
System.out.print("Enter your birth month, birthday, and year with a space between each: ");
String birth = sc.nextLine();
System.out.println("First Middle Last");
System.out.println(name + "\n");
System.out.println("Month Day Year");
System.out.println(birth + "\n");
notice how the scanner will read the 3 names... but after that all 3 names are in the string "name" is there a way to assign each name (first, middle and last) its own STRING while being able to enter all 3 on the same line with a space between. Cause with this code when i output it its pretty ugly and doesnt like like a table at all. I need to have a /t between each name and such but i am unable to do that because all the names are in the same string.