cheezncrackers95
2011-09-28 22:16:50 UTC
On what day of the month were you born? (8)
What is the name of the month in which you were born? (May)
During what year were you born? (1981)
You were born on May 8, 1981. You're might old!
I'm calling a method because this code is part of a larger program.
My main method includes:
Scanner console = new Scanner(System.in);
inputBirthday(console);
System.out.println();
This is my method so far, but I keep getting errors? Any help is greatly appreciated! :)
public static void inputBirthday
{
System.out.print("On what day of the month were you born?");
int day = console.nextInt();
System.out.print("What is the name of the month in which you were born?");
int month = console.next();
System.out.print("During what year were you born?");
int year = console.nextInt();
System.out.print("You were born on");
System.out.print(month + day + ',' + year + '.');
System.out.print("You're mighty old!");
}
}